+
Point of view
All features
deferred class FLOAT
Summary
This class defines the floating-point operations.
Direct parents
Inherit list: COMPARABLE, NUMERIC
Known children
Inherit list: REAL_GENERAL
Overview
Features
{ANY}
Conversions:
{ANY}
• rounded: FLOAT
Round to nearest integer away from zero.
• floor: FLOAT
Largest integral value no greater than Current.
• ceiling: FLOAT
Smallest integral value no smaller than Current.
Object Printing:
{ANY}
Maths functions:
{ANY}
• sqrt: FLOAT
Square root of Current.
• sin: FLOAT
Sine of Current.
• cos: FLOAT
Cosine of Current.
• tan: FLOAT
Tangent of Current.
• asin: FLOAT
Arc Sine of Current.
• acos: FLOAT
Arc Cosine of Current.
• atan: FLOAT
Arc Tangent of Current.
• atan2 (x: FLOAT): FLOAT
Arc Tangent of Current / x.
• sinh: FLOAT
Hyperbolic Sine of Current.
• cosh: FLOAT
Hyperbolic Cosine of Current.
• tanh: FLOAT
Hyperbolic Tangent of Current.
• exp: FLOAT
Exponential of Current.
• log: FLOAT
Natural Logarithm of Current.
• log10: FLOAT
Base-10 Logarithm of Current.
• pow (e: FLOAT): FLOAT
Current raised to the power of e (ANSI C pow).
Hashing:
{ANY}
Miscellaneous:
{ANY}
• sign: INTEGER_8
Sign of Current (0 -1 or 1).
• mantissa_bits: INTEGER_8
Give the number of bits, corresponding to the mantissa, in the binary representation of the real number.
• exponent_bits: INTEGER_8
Give the number of bits, corresponding to the exponent, in the binary representation of the real number.
{ANY}
• prefix "+": FLOAT
Unary plus of Current.
• prefix "-": FLOAT
Unary minus of Current.
• one: FLOAT
Neutral element for "*" and "/".
• zero: FLOAT
Neutral element for "+" and "-".
{ANY}
• is_equal (other: FLOAT): BOOLEAN
Is other attached to an object considered equal to current object?
{ANY}
• infix "<" (other: FLOAT): BOOLEAN
Is Current strictly less than other?
• infix "<=" (other: FLOAT): BOOLEAN
Is Current less than or equal other?
• infix ">" (other: FLOAT): BOOLEAN
Is Current strictly greater than other?
• infix ">=" (other: FLOAT): BOOLEAN
Is Current greater than or equal than other?
• in_range (lower: FLOAT, upper: FLOAT): BOOLEAN
Return True if Current is in range [lower..upper]
• compare (other: FLOAT): INTEGER_32
If current object equal to other, 0 if smaller, -1; if greater, 1.
• three_way_comparison (other: FLOAT): INTEGER_32
If current object equal to other, 0 if smaller, -1; if greater, 1.
• min (other: FLOAT): FLOAT
Minimum of Current and other.
• max (other: FLOAT): FLOAT
Maximum of Current and other.
• bounded_by (a_min: FLOAT, a_max: FLOAT): FLOAT
A value that is equal to Current if it is between the limits set by a_min and a_max.
infix "+" (another: FLOAT): FLOAT
deferred function
{ANY}
Sum with other (commutative).
infix "-" (another: FLOAT): FLOAT
deferred function
{ANY}
Result of subtracting other.
infix "*" (another: FLOAT): FLOAT
deferred function
{ANY}
Product by other.
infix "/" (another: FLOAT): FLOAT
deferred function
{ANY}
Division by other.
infix "^" (another: INTEGER_32): FLOAT
deferred function
{ANY}
abs: FLOAT
deferred function
{ANY}
is_not_a_number: BOOLEAN
deferred function
{ANY}
Also known as NaN in IEEE-754.
is_infinity: BOOLEAN
deferred function
{ANY}
Is either plus or minus infinity?
is_zero: BOOLEAN
deferred function
{ANY}
Is either -0.0 or +0.0 ?
infix "~=" (other: FLOAT): BOOLEAN
deferred function
{ANY}
Is Current near equal to other.
is_subnormal: BOOLEAN
deferred function
{ANY}
Is it too small to be represented in normalized format.
is_normal: BOOLEAN
deferred function
{ANY}
The most general situation (see ensure).
divisible (other: FLOAT): BOOLEAN
deferred function
{ANY}
May Current be divided by other ?
rounded: FLOAT
frozen
deferred function
{ANY}
Round to nearest integer away from zero.
floor: FLOAT
frozen
deferred function
{ANY}
Largest integral value no greater than Current.
ceiling: FLOAT
frozen
deferred function
{ANY}
Smallest integral value no smaller than Current.
to_string: STRING
deferred function
{ANY}
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
deferred function
{ANY}
Convert Current into a new allocated STRING using f digits for fractional part.
to_string_scientific (f: INTEGER_32): STRING
deferred function
{ANY}
Convert Current into a new allocated STRING, using the scientific notation with f digits for the fractional part.
append_in (buffer: STRING)
deferred procedure
{ANY}
Append the equivalent of to_string at the end of buffer.
append_in_format (str: STRING, f: INTEGER_32)
deferred procedure
{ANY}
Append the equivalent of to_string_format at the end of buffer.
append_in_scientific (str: STRING, f: INTEGER_32)
deferred procedure
{ANY}
Append the equivalent of to_string_scientific at the end of buffer.
sqrt: FLOAT
frozen
deferred function
{ANY}
Square root of Current.
sin: FLOAT
frozen
deferred function
{ANY}
Sine of Current.
cos: FLOAT
frozen
deferred function
{ANY}
Cosine of Current.
tan: FLOAT
frozen
deferred function
{ANY}
Tangent of Current.
asin: FLOAT
frozen
deferred function
{ANY}
Arc Sine of Current.
acos: FLOAT
frozen
deferred function
{ANY}
Arc Cosine of Current.
atan: FLOAT
frozen
deferred function
{ANY}
Arc Tangent of Current.
atan2 (x: FLOAT): FLOAT
frozen
deferred function
{ANY}
Arc Tangent of Current / x.
sinh: FLOAT
frozen
deferred function
{ANY}
Hyperbolic Sine of Current.
cosh: FLOAT
frozen
deferred function
{ANY}
Hyperbolic Cosine of Current.
tanh: FLOAT
frozen
deferred function
{ANY}
Hyperbolic Tangent of Current.
exp: FLOAT
frozen
deferred function
{ANY}
Exponential of Current.
log: FLOAT
frozen
deferred function
{ANY}
Natural Logarithm of Current.
log10: FLOAT
frozen
deferred function
{ANY}
Base-10 Logarithm of Current.
pow (e: FLOAT): FLOAT
frozen
deferred function
{ANY}
Current raised to the power of e (ANSI C pow).
hash_code: INTEGER_32
deferred function
{ANY}
The hash-code value of Current.
sign: INTEGER_8
deferred function
{ANY}
Sign of Current (0 -1 or 1).
mantissa_bits: INTEGER_8
deferred function
{ANY}
Give the number of bits, corresponding to the mantissa, in the binary representation of the real number.
exponent_bits: INTEGER_8
deferred function
{ANY}
Give the number of bits, corresponding to the exponent, in the binary representation of the real number.
prefix "+": FLOAT
deferred function
{ANY}
Unary plus of Current.
prefix "-": FLOAT
deferred function
{ANY}
Unary minus of Current.
one: FLOAT
deferred function
{ANY}
Neutral element for "*" and "/".
zero: FLOAT
deferred function
{ANY}
Neutral element for "+" and "-".
is_equal (other: FLOAT): BOOLEAN
deferred function
{ANY}
Is other attached to an object considered equal to current object?
infix "<" (other: FLOAT): BOOLEAN
deferred function
{ANY}
Is Current strictly less than other?
infix "<=" (other: FLOAT): BOOLEAN
effective function
{ANY}
Is Current less than or equal other?
infix ">" (other: FLOAT): BOOLEAN
effective function
{ANY}
Is Current strictly greater than other?
infix ">=" (other: FLOAT): BOOLEAN
effective function
{ANY}
Is Current greater than or equal than other?
in_range (lower: FLOAT, upper: FLOAT): BOOLEAN
effective function
{ANY}
Return True if Current is in range [lower..upper]
compare (other: FLOAT): INTEGER_32
effective function
{ANY}
If current object equal to other, 0 if smaller, -1; if greater, 1.
three_way_comparison (other: FLOAT): INTEGER_32
effective function
{ANY}
If current object equal to other, 0 if smaller, -1; if greater, 1.
min (other: FLOAT): FLOAT
effective function
{ANY}
Minimum of Current and other.
max (other: FLOAT): FLOAT
effective function
{ANY}
Maximum of Current and other.
bounded_by (a_min: FLOAT, a_max: FLOAT): FLOAT
effective function
{ANY}
A value that is equal to Current if it is between the limits set by a_min and a_max.