+
Point of view
All features
deferred class REAL_GENERAL
Summary
Common anchestor of floating-point arithmetic classes, also known as REAL numbers: REAL_32, REAL_64, REAL_128, REAL_EXTENDED.
Direct parents
Inherit list: FLOAT
Insert list: REAL_PRECISION
Known children
Insert list: REAL_128, REAL_32, REAL_64, REAL_80, REAL_EXTENDED
Overview
Features
{ANY}
Conversions:
{ANY}
• rounded: REAL_GENERAL
Round to nearest integer away from zero.
• floor: REAL_GENERAL
Largest integral value no greater than Current.
• ceiling: REAL_GENERAL
Smallest integral value no smaller than Current.
Object Printing:
{ANY}
Maths functions:
{ANY}
• sqrt: REAL_GENERAL
Square root of Current.
• sin: REAL_GENERAL
Sine of Current.
• cos: REAL_GENERAL
Cosine of Current.
• tan: REAL_GENERAL
Tangent of Current.
• asin: REAL_GENERAL
Arc Sine of Current.
• acos: REAL_GENERAL
Arc Cosine of Current.
• atan: REAL_GENERAL
Arc Tangent of Current.
• atan2 (x: REAL_GENERAL): REAL_GENERAL
Arc Tangent of Current / x.
• sinh: REAL_GENERAL
Hyperbolic Sine of Current.
• cosh: REAL_GENERAL
Hyperbolic Cosine of Current.
• tanh: REAL_GENERAL
Hyperbolic Tangent of Current.
• exp: REAL_GENERAL
Exponential of Current.
• log: REAL_GENERAL
Natural Logarithm of Current.
• log10: REAL_GENERAL
Base-10 Logarithm of Current.
• pow (e: REAL_GENERAL): REAL_GENERAL
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}
• one: REAL_GENERAL
Neutral element for "*" and "/".
• zero: REAL_GENERAL
Neutral element for "+" and "-".
{ANY}
• in_range (lower: REAL_GENERAL, upper: REAL_GENERAL): BOOLEAN
Return True if Current is in range [lower..upper]
• compare (other: REAL_GENERAL): INTEGER_32
If current object equal to other, 0 if smaller, -1; if greater, 1.
• three_way_comparison (other: REAL_GENERAL): INTEGER_32
If current object equal to other, 0 if smaller, -1; if greater, 1.
• min (other: REAL_GENERAL): REAL_GENERAL
Minimum of Current and other.
• max (other: REAL_GENERAL): REAL_GENERAL
Maximum of Current and other.
• bounded_by (a_min: REAL_GENERAL, a_max: REAL_GENERAL): REAL_GENERAL
A value that is equal to Current if it is between the limits set by a_min and a_max.
{ANY}
• set_precision (a_precision: INTEGER_8)
Set the mantissa precision, used by the ~= operator The nearer to 0, the more precise.
{}
is_equal (other: REAL_GENERAL): BOOLEAN
effective function
{ANY}
Is other attached to an object considered equal to current object?
prefix "+": REAL_GENERAL
effective function
{ANY}
Unary plus of Current.
prefix "-": REAL_GENERAL
{ANY}
Unary minus of Current.
infix "+" (other: REAL_GENERAL): REAL_GENERAL
{ANY}
Sum with other (commutative).
infix "-" (other: REAL_GENERAL): REAL_GENERAL
{ANY}
Result of subtracting other.
infix "*" (other: REAL_GENERAL): REAL_GENERAL
{ANY}
Product by other.
infix "/" (other: REAL_GENERAL): REAL_GENERAL
{ANY}
Division by other.
infix "^" (e: INTEGER_32): REAL_GENERAL
{ANY}
infix "<" (other: REAL_GENERAL): BOOLEAN
{ANY}
Is Current strictly less than other?
infix "<=" (other: REAL_GENERAL): BOOLEAN
{ANY}
Is Current less than or equal other?
infix ">" (other: REAL_GENERAL): BOOLEAN
{ANY}
Is Current strictly greater than other?
infix ">=" (other: REAL_GENERAL): BOOLEAN
{ANY}
Is Current greater than or equal than other?
abs: REAL_GENERAL
effective function
{ANY}
is_not_a_number: BOOLEAN
{ANY}
Also known as NaN in IEEE-754.
is_infinity: BOOLEAN
{ANY}
Is either plus or minus infinity?
is_zero: BOOLEAN
effective function
{ANY}
Is either -0.0 or +0.0 ?
infix "~=" (other: REAL_GENERAL): BOOLEAN
deferred function
{ANY}
Is Current near equal to other.
precision: INTEGER_8
effective function
{ANY}
is_subnormal: BOOLEAN
{ANY}
Is it too small to be represented in normalized format.
is_normal: BOOLEAN
{ANY}
The most general situation (see ensure).
divisible (other: REAL_GENERAL): BOOLEAN
effective function
{ANY}
May Current be divided by other ?
rounded: REAL_GENERAL
frozen
{ANY}
Round to nearest integer away from zero.
floor: REAL_GENERAL
frozen
{ANY}
Largest integral value no greater than Current.
ceiling: REAL_GENERAL
frozen
{ANY}
Smallest integral value no smaller than Current.
to_string: STRING
effective 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
effective function
{ANY}
Convert Current into a new allocated STRING using f digits for fractional part.
to_string_scientific (f: INTEGER_32): STRING
effective function
{ANY}
Convert Current into a new allocated STRING, using the scientific notation with f digits for the fractional part.
append_in (buffer: STRING)
effective procedure
{ANY}
Append the equivalent of to_string at the end of buffer.
append_in_format (str: STRING, f: INTEGER_32)
effective procedure
{ANY}
Append the equivalent of to_string_format at the end of buffer.
append_in_scientific (str: STRING, f: INTEGER_32)
effective procedure
{ANY}
Append the equivalent of to_string_scientific at the end of buffer.
out_in_tagged_out_memory
effective procedure
{ANY}
Append terse printable representation of current object in tagged_out_memory.
fill_tagged_out_memory
effective procedure
{ANY}
Append a viewable information in tagged_out_memory in order to affect the behavior of out, tagged_out, etc.
sqrt: REAL_GENERAL
frozen
{ANY}
Square root of Current.
sin: REAL_GENERAL
frozen
{ANY}
Sine of Current.
cos: REAL_GENERAL
frozen
{ANY}
Cosine of Current.
tan: REAL_GENERAL
frozen
{ANY}
Tangent of Current.
asin: REAL_GENERAL
frozen
{ANY}
Arc Sine of Current.
acos: REAL_GENERAL
frozen
{ANY}
Arc Cosine of Current.
atan: REAL_GENERAL
frozen
{ANY}
Arc Tangent of Current.
atan2 (x: REAL_GENERAL): REAL_GENERAL
frozen
{ANY}
Arc Tangent of Current / x.
sinh: REAL_GENERAL
frozen
{ANY}
Hyperbolic Sine of Current.
cosh: REAL_GENERAL
frozen
{ANY}
Hyperbolic Cosine of Current.
tanh: REAL_GENERAL
frozen
{ANY}
Hyperbolic Tangent of Current.
exp: REAL_GENERAL
frozen
{ANY}
Exponential of Current.
log: REAL_GENERAL
frozen
{ANY}
Natural Logarithm of Current.
log10: REAL_GENERAL
frozen
{ANY}
Base-10 Logarithm of Current.
pow (e: REAL_GENERAL): REAL_GENERAL
frozen
{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
effective 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.
sprintf_buffer: NATIVE_ARRAY[CHARACTER]
once function
{}
sprintf (buffer: NATIVE_ARRAY[CHARACTER], mode: CHARACTER, f: INTEGER_32, value: REAL_GENERAL)
deferred procedure
{}
Put in the buffer a viewable version of the value using mode with f digits for the fractional part.
one: REAL_GENERAL
deferred function
{ANY}
Neutral element for "*" and "/".
zero: REAL_GENERAL
deferred function
{ANY}
Neutral element for "+" and "-".
in_range (lower: REAL_GENERAL, upper: REAL_GENERAL): BOOLEAN
effective function
{ANY}
Return True if Current is in range [lower..upper]
compare (other: REAL_GENERAL): INTEGER_32
effective function
{ANY}
If current object equal to other, 0 if smaller, -1; if greater, 1.
three_way_comparison (other: REAL_GENERAL): INTEGER_32
effective function
{ANY}
If current object equal to other, 0 if smaller, -1; if greater, 1.
min (other: REAL_GENERAL): REAL_GENERAL
effective function
{ANY}
Minimum of Current and other.
max (other: REAL_GENERAL): REAL_GENERAL
effective function
{ANY}
Maximum of Current and other.
bounded_by (a_min: REAL_GENERAL, a_max: REAL_GENERAL): REAL_GENERAL
effective function
{ANY}
A value that is equal to Current if it is between the limits set by a_min and a_max.
set_precision (a_precision: INTEGER_8)
effective procedure
{ANY}
Set the mantissa precision, used by the ~= operator The nearer to 0, the more precise.
precision_ref: REFERENCE[INTEGER_8]
once function
{}