GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
NUMERIC
+
Point of view
All features
ANY
All features
deferred class NUMERIC
Summary
top
This class describes a ring.
Direct parents
Inherit list:
HASHABLE
Known children
Inherit list:
FLOAT
,
NUMBER
Insert list:
COMPLEX_GENERAL
,
INTEGRAL
Overview
top
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
}
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
{
ANY
}
top
Sum with
other
(commutative).
infix "-"
(other: NUMERIC): NUMERIC
deferred function
{
ANY
}
top
Result of subtracting
other
.
infix "*"
(other: NUMERIC): NUMERIC
deferred function
{
ANY
}
top
Product by
other
.
infix "/"
(other: NUMERIC): NUMERIC
deferred function
{
ANY
}
top
Division by
other
.
require
other /= Void
other /=
zero
divisible
(other)
prefix "+"
: NUMERIC
deferred function
{
ANY
}
top
Unary plus of
Current
.
prefix "-"
: NUMERIC
deferred function
{
ANY
}
top
Unary minus of
Current
.
divisible
(other: NUMERIC):
BOOLEAN
deferred function
{
ANY
}
top
May
Current
be divided by
other
?
require
other /= Void
one
: NUMERIC
deferred function
{
ANY
}
top
Neutral element for
"*"
and
"/"
.
zero
: NUMERIC
deferred function
{
ANY
}
top
Neutral element for
"+"
and
"-"
.
sign
:
INTEGER_8
deferred function
{
ANY
}
top
Sign of Current (0 -1 or 1).
ensure
Result.in_range(-1, 1)
hash_code
:
INTEGER_32
deferred function
{
ANY
}
top
The hash-code value of
Current
.
ensure
good_hash_value:
Result >= 0
is_equal
(other: NUMERIC):
BOOLEAN
deferred function
{
ANY
}
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)