+
Point of view
All features
deferred class NUMERIC
Summary
This class describes a ring.
Direct parents
Inherit list: HASHABLE
Known children
Inherit list: FLOAT, NUMBER
Insert list: COMPLEX_GENERAL, INTEGRAL
Overview
Features
{ANY}
  • infix "+" (other: NUMERIC): NUMERIC
    Sum with other (commutative).
  • infix "-" (other: NUMERIC): NUMERIC
    Result of subtracting other.
  • infix "*" (other: NUMERIC): NUMERIC
    Product by other.
  • infix "/" (other: NUMERIC): NUMERIC
    Division by other.
  • prefix "+": NUMERIC
    Unary plus of Current.
  • prefix "-": NUMERIC
    Unary minus of Current.
  • divisible (other: NUMERIC): BOOLEAN
    May Current be divided by other ?
  • one: NUMERIC
    Neutral element for "*" and "/".
  • zero: NUMERIC
    Neutral element for "+" and "-".
  • sign: INTEGER_8
    Sign of Current (0 -1 or 1).
{ANY}
infix "+" (other: NUMERIC): NUMERIC
deferred function
{ANY}
Sum with other (commutative).
infix "-" (other: NUMERIC): NUMERIC
deferred function
{ANY}
Result of subtracting other.
infix "*" (other: NUMERIC): NUMERIC
deferred function
{ANY}
Product by other.
infix "/" (other: NUMERIC): NUMERIC
deferred function
{ANY}
Division by other.
require
prefix "+": NUMERIC
deferred function
{ANY}
Unary plus of Current.
prefix "-": NUMERIC
deferred function
{ANY}
Unary minus of Current.
divisible (other: NUMERIC): BOOLEAN
deferred function
{ANY}
May Current be divided by other ?
require
  • other /= Void
one: NUMERIC
deferred function
{ANY}
Neutral element for "*" and "/".
zero: NUMERIC
deferred function
{ANY}
Neutral element for "+" and "-".
sign: INTEGER_8
deferred function
{ANY}
Sign of Current (0 -1 or 1).
ensure
  • Result.in_range(-1, 1)
hash_code: INTEGER_32
deferred function
{ANY}
The hash-code value of Current.
ensure
  • good_hash_value: Result >= 0
is_equal (other: NUMERIC): BOOLEAN
deferred function
{ANY}
Is other attached to an object considered equal to current object?
require
  • other /= Void
ensure
  • Result implies hash_code = other.hash_code
  • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)