home
wiki
classes/clusters list
class information
+
Point of view
ANY
ANY
INTERNALS_HANDLER
All features
expanded class REAL_80
Summary
top
80 bits floating point.
Warning: this
REAL_80
class is architecture dependent.
See also
REAL_32
,
REAL_64
,
REAL_128
,
REAL_EXTENDED
.
Direct parents
insert list:
REAL_GENERAL
Overview
top
exported features
Conversions:
force_to_real_32
:
REAL_32
force_to_real_64
:
REAL_64
force_to_integer_64
:
INTEGER_64
force_to_integer_32
:
INTEGER_32
force_to_integer_16
:
INTEGER_16
zero
:
REAL_32
Neutral element for
"+"
and
"-"
.
one
:
REAL_32
Neutral element for
"*"
and
"/"
.
infix "~="
(other: REAL_80):
BOOLEAN
Is
Current
near equal to
other
.
hash_code
:
INTEGER_32
The hash-code value of
Current
.
mantissa_bits
:
INTEGER_8
exponent_bits
:
INTEGER_8
Give the number of bits, corresponding to the exponent, in the binary representation of the real number.
is_equal
(other: REAL_80):
BOOLEAN
Is
other
attached to an object considered equal to current object?
prefix "+"
: REAL_80
Unary plus of
Current
.
prefix "-"
: REAL_80
Unary minus of
Current
.
infix "+"
(other: REAL_80): REAL_80
Sum with
other
(commutative).
infix "-"
(other: REAL_80): REAL_80
Result of substracting
other
.
infix "*"
(other: REAL_80): REAL_80
Product by
other
.
infix "/"
(other: REAL_80): REAL_80
Division by
other
.
infix "^"
(e:
INTEGER_32
): REAL_80
Raise Current to
e
-th power (see also
pow
).
infix "<"
(other: REAL_80):
BOOLEAN
Is
Current
strictly less than
other
?
infix "<="
(other: REAL_80):
BOOLEAN
Is
Current
less than or equal
other
?
infix ">"
(other: REAL_80):
BOOLEAN
Is
Current
strictly greater than
other
?
infix ">="
(other: REAL_80):
BOOLEAN
Is
Current
greater than or equal than
other
?
abs
: REAL_80
is_not_a_number
:
BOOLEAN
Also known as NaN in IEEE-754.
is_infinity
:
BOOLEAN
Is either plus or minus infinity?
is_zero
:
BOOLEAN
Is either -0.0 or +0.0 ?
is_subnormal
:
BOOLEAN
Is it too small to be represented in normalized format.
is_normal
:
BOOLEAN
The most general situation (see ensure).
divisible
(other: REAL_80):
BOOLEAN
May
Current
be divided by
other
?
Conversions:
rounded
: REAL_80
Round to nearest integer away from zero.
floor
: REAL_80
Largest integral value no greater than Current.
ceiling
: REAL_80
Smallest integral value no smaller than Current.
Object Printing:
to_string
:
STRING
Convert
Current
into a new allocated
STRING
using 6 as the default number of digits for the fractional part.
to_string_format
(f:
INTEGER_32
):
STRING
Convert
Current
into a new allocated
STRING
using
f
digits for fractional part.
to_string_scientific
(f:
INTEGER_32
):
STRING
Convert
Current
into a new allocated
STRING
, using the scientific notation with
f
digits for the fractional part.
append_in
(buffer:
STRING
)
Append the equivalent of
to_string
at the end of
buffer
.
append_in_format
(str:
STRING
, f:
INTEGER_32
)
Append the equivalent of
to_string_format
at the end of
buffer
.
append_in_scientific
(str:
STRING
, f:
INTEGER_32
)
Append the equivalent of
to_string_scientific
at the end of
buffer
.
out_in_tagged_out_memory
Append terse printable represention of current object in
tagged_out_memory
.
fill_tagged_out_memory
Append a viewable information in
tagged_out_memory
in order to affect the behavior of
out
,
tagged_out
, etc.
Maths functions:
sqrt
: REAL_80
Square root of
Current
.
sin
: REAL_80
Sine of
Current
.
cos
: REAL_80
Cosine of
Current
.
tan
: REAL_80
Tangent of
Current
.
asin
: REAL_80
Arc Sine of
Current
.
acos
: REAL_80
Arc Cosine of
Current
.
atan
: REAL_80
Arc Tangent of
Current
.
atan2
(x: REAL_80): REAL_80
Arc Tangent of
Current
/
x
.
sinh
: REAL_80
Hyperbolic Sine of
Current
.
cosh
: REAL_80
Hyperbolic Cosine of
Current
.
tanh
: REAL_80
Hyperbolic Tangent of
Current
.
exp
: REAL_80
Exponential of
Current
.
log
: REAL_80
Natural Logarithm of
Current
.
log10
: REAL_80
Base-10 Logarithm of Current.
pow
(e: REAL_80): REAL_80
Current
raised to the power of
e
(ANSI C
pow
).
Miscellaneous:
sign
:
INTEGER_8
Sign of
Current
(0 -1 or 1).
in_range
(lower: REAL_80, upper: REAL_80):
BOOLEAN
Return True if
Current
is in range [
lower
..
upper
]
See also
min
,
max
,
compare
.
compare
(other: REAL_80):
INTEGER_32
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
three_way_comparison
(other: REAL_80):
INTEGER_32
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
min
(other: REAL_80): REAL_80
Minimum of
Current
and
other
.
max
(other: REAL_80): REAL_80
Maximum of
Current
and
other
.
force_to_real_32
:
REAL_32
top
force_to_real_64
:
REAL_64
top
force_to_integer_64
:
INTEGER_64
top
force_to_integer_32
:
INTEGER_32
top
force_to_integer_16
:
INTEGER_16
top
zero
:
REAL_32
constant attribute
top
Neutral element for
"+"
and
"-"
.
one
:
REAL_32
constant attribute
top
Neutral element for
"*"
and
"/"
.
infix "~="
(other: REAL_80):
BOOLEAN
effective function
top
Is
Current
near equal to
other
.
hash_code
:
INTEGER_32
effective function
top
The hash-code value of
Current
.
ensure
good_hash_value:
Result >= 0
mantissa_bits
:
INTEGER_8
constant attribute
top
exponent_bits
:
INTEGER_8
constant attribute
top
Give the number of bits, corresponding to the exponent, in the binary representation of the real number.
is_equal
(other: REAL_80):
BOOLEAN
effective function
top
Is
other
attached to an object considered equal to current object?
require
other /= Void
ensure
trichotomy:
Result = not Current < other and not other < Current
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
Result implies hash_code = other.hash_code
prefix "+"
: REAL_80
effective function
top
Unary plus of
Current
.
prefix "-"
: REAL_80
top
Unary minus of
Current
.
infix "+"
(other: REAL_80): REAL_80
top
Sum with
other
(commutative).
infix "-"
(other: REAL_80): REAL_80
top
Result of substracting
other
.
infix "*"
(other: REAL_80): REAL_80
top
Product by
other
.
infix "/"
(other: REAL_80): REAL_80
top
Division by
other
.
require
other /= Void
divisible(other)
infix "^"
(e:
INTEGER_32
): REAL_80
top
Raise Current to
e
-th power (see also
pow
).
infix "<"
(other: REAL_80):
BOOLEAN
top
Is
Current
strictly less than
other
?
See also
>
,
<=
,
>=
,
min
,
max
.
require
other_exists:
other /= Void
ensure
asymmetric:
Result implies not other < Current
infix "<="
(other: REAL_80):
BOOLEAN
top
Is
Current
less than or equal
other
?
See also
>=
,
<
,
>
,
min
,
max
.
require
other_exists:
other /= Void
ensure
definition:
Result = Current < other or is_equal(other)
infix ">"
(other: REAL_80):
BOOLEAN
top
Is
Current
strictly greater than
other
?
See also
<
,
>=
,
<=
,
min
,
max
.
require
other_exists:
other /= Void
ensure
definition:
Result = other < Current
infix ">="
(other: REAL_80):
BOOLEAN
top
Is
Current
greater than or equal than
other
?
See also
<=
,
>
,
<
,
min
,
max
.
require
other_exists:
other /= Void
ensure
definition:
Result = other <= Current
abs
: REAL_80
effective function
top
is_not_a_number
:
BOOLEAN
top
Also known as NaN in IEEE-754.
is_infinity
:
BOOLEAN
top
Is either plus or minus infinity?
is_zero
:
BOOLEAN
effective function
top
Is either -0.0 or +0.0 ?
is_subnormal
:
BOOLEAN
top
Is it too small to be represented in normalized format.
ensure
Result = Current = 0.0 or else Current = -0.0
is_normal
:
BOOLEAN
top
The most general situation (see ensure).
ensure
Result = not
is_subnormal
or
is_infinity
or
is_not_a_number
divisible
(other: REAL_80):
BOOLEAN
effective function
top
May
Current
be divided by
other
?
require
other /= Void
rounded
: REAL_80
frozen
top
Round to nearest integer away from zero.
floor
: REAL_80
frozen
top
Largest integral value no greater than Current.
ceiling
: REAL_80
frozen
top
Smallest integral value no smaller than Current.
to_string
:
STRING
effective function
top
Convert
Current
into a new allocated
STRING
using 6 as the default number of digits for the fractional part.
Exemple:
(1.5).to_string
will return
"1.500000"
.
Note: see also
to_string_format
,
to_string_scientific
as well as
append_in
to save memory.
to_string_format
(f:
INTEGER_32
):
STRING
effective function
top
Convert
Current
into a new allocated
STRING
using
f
digits for fractional part.
Exemple:
(1.5).to_string_format(2)
will return
"1.50"
.
Note: see also
to_string_scientific
,
to_string
as well as
append_in_format
to save memory.
require
f >= 0
to_string_scientific
(f:
INTEGER_32
):
STRING
effective function
top
Convert
Current
into a new allocated
STRING
, using the scientific notation with
f
digits for the fractional part.
Exemple:
(155.5).to_string_scientific(4)
will return
"1.5550e+02"
.
Note: see also
to_string
,
to_string_format
as well as
append_in_scientific
to save memory.
append_in
(buffer:
STRING
)
effective procedure
top
Append the equivalent of
to_string
at the end of
buffer
.
Thus you can save memory because no other
STRING
is allocated for the job.
require
buffer /= Void
append_in_format
(str:
STRING
, f:
INTEGER_32
)
effective procedure
top
Append the equivalent of
to_string_format
at the end of
buffer
.
Thus you can save memory because no other
STRING
is allocated for the job.
require
str /= Void
f >= 0
append_in_scientific
(str:
STRING
, f:
INTEGER_32
)
effective procedure
top
Append the equivalent of
to_string_scientific
at the end of
buffer
.
Thus you can save memory because no other
STRING
is allocated for the job.
require
str /= Void
f >= 0
out_in_tagged_out_memory
effective procedure
top
Append terse printable represention of current object in
tagged_out_memory
.
ensure
not_cleared:
tagged_out_memory.count >= old tagged_out_memory.count
append_only:
old tagged_out_memory.twin.is_equal(tagged_out_memory.substring(1, old tagged_out_memory.count))
fill_tagged_out_memory
effective procedure
top
Append a viewable information in
tagged_out_memory
in order to affect the behavior of
out
,
tagged_out
, etc.
sqrt
: REAL_80
frozen
top
Square root of
Current
.
require
Current
>=
0.0
sin
: REAL_80
frozen
top
Sine of
Current
.
cos
: REAL_80
frozen
top
Cosine of
Current
.
tan
: REAL_80
frozen
top
Tangent of
Current
.
asin
: REAL_80
frozen
top
Arc Sine of
Current
.
acos
: REAL_80
frozen
top
Arc Cosine of
Current
.
atan
: REAL_80
frozen
top
Arc Tangent of
Current
.
atan2
(x: REAL_80): REAL_80
frozen
top
Arc Tangent of
Current
/
x
.
sinh
: REAL_80
frozen
top
Hyperbolic Sine of
Current
.
cosh
: REAL_80
frozen
top
Hyperbolic Cosine of
Current
.
tanh
: REAL_80
frozen
top
Hyperbolic Tangent of
Current
.
exp
: REAL_80
frozen
top
Exponential of
Current
.
log
: REAL_80
frozen
top
Natural Logarithm of
Current
.
log10
: REAL_80
frozen
top
Base-10 Logarithm of Current.
pow
(e: REAL_80): REAL_80
frozen
top
Current
raised to the power of
e
(ANSI C
pow
).
sign
:
INTEGER_8
effective function
top
Sign of
Current
(0 -1 or 1).
ensure
Result.in_range(-1, 1)
in_range
(lower: REAL_80, upper: REAL_80):
BOOLEAN
effective function
top
Return True if
Current
is in range [
lower
..
upper
]
See also
min
,
max
,
compare
.
ensure
Result = Current
>=
lower and Current
<=
upper
compare
(other: REAL_80):
INTEGER_32
effective function
top
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
See also
min
,
max
,
in_range
.
require
other_exists:
other /= Void
ensure
equal_zero:
Result = 0 =
is_equal
(other)
smaller_negative:
Result = -1 = Current
<
other
greater_positive:
Result = 1 = Current
>
other
three_way_comparison
(other: REAL_80):
INTEGER_32
effective function
top
If current object equal to
other
, 0 if smaller, -1; if greater, 1.
See also
min
,
max
,
in_range
.
require
other_exists:
other /= Void
ensure
equal_zero:
Result = 0 =
is_equal
(other)
smaller_negative:
Result = -1 = Current
<
other
greater_positive:
Result = 1 = Current
>
other
min
(other: REAL_80): REAL_80
effective function
top
Minimum of
Current
and
other
.
See also
max
,
in_range
.
require
other /= Void
ensure
Result
<=
Current and then Result
<=
other
compare
(Result) = 0 or else other.
compare
(Result) = 0
max
(other: REAL_80): REAL_80
effective function
top
Maximum of
Current
and
other
.
See also
min
,
in_range
.
require
other /= Void
ensure
Result
>=
Current and then Result
>=
other
compare
(Result) = 0 or else other.
compare
(Result) = 0