home
wiki
classes/clusters list
class information
+
Point of view
All features
ANY
INTERNALS_HANDLER
All features
deferred class NUMERIC
Summary
top
This class describes a ring.
Direct parents
inherit list:
HASHABLE
Known children
inherit list:
NUMBER
,
REAL_GENERAL
insert list:
INTEGER_GENERAL
Overview
top
features
infix "+"
(other: NUMERIC): NUMERIC
Sum with
other
(commutative).
infix "-"
(other: NUMERIC): NUMERIC
Result of substracting
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).
hash_code
:
INTEGER_32
The hash-code value of
Current
.
is_equal
(other: NUMERIC):
BOOLEAN
Is
other
attached to an object considered equal to current object?
infix "+"
(other: NUMERIC): NUMERIC
deferred function
top
Sum with
other
(commutative).
infix "-"
(other: NUMERIC): NUMERIC
deferred function
top
Result of substracting
other
.
infix "*"
(other: NUMERIC): NUMERIC
deferred function
top
Product by
other
.
infix "/"
(other: NUMERIC): NUMERIC
deferred function
top
Division by
other
.
require
other /= Void
divisible
(other)
prefix "+"
: NUMERIC
deferred function
top
Unary plus of
Current
.
prefix "-"
: NUMERIC
deferred function
top
Unary minus of
Current
.
divisible
(other: NUMERIC):
BOOLEAN
deferred function
top
May
Current
be divided by
other
?
require
other /= Void
one
: NUMERIC
deferred function
top
Neutral element for
"*"
and
"/"
.
zero
: NUMERIC
deferred function
top
Neutral element for
"+"
and
"-"
.
sign
:
INTEGER_8
deferred function
top
Sign of Current (0 -1 or 1).
ensure
Result.in_range(-1, 1)
hash_code
:
INTEGER_32
deferred function
top
The hash-code value of
Current
.
ensure
good_hash_value:
Result >= 0
is_equal
(other: NUMERIC):
BOOLEAN
deferred function
top
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)