+
Point of view
ANY
deferred class FRACTION_GENERAL_NUMBER
Summary
Class invariant
• denominator @>= 2
• not numerator.is_zero
• denominator.is_positive
• is_integer_general_number implies denominator.is_one
• not is_integer_general_number implies numerator.gcd(denominator) @= 1
Overview
exported features
Misc:
Binary operators for two NUMBERs:
Unary operators for two NUMBERs:
To know more about a NUMBER:
Conversions and printing:
To mimic NUMERIC:
To mix NUMBER and INTEGER_64:
To mix NUMBER and REAL_64:
Misc:
is_zero: BOOLEAN
constant attribute
Is it 0 ?
is_one: BOOLEAN
constant attribute
Is it 1 ?
is_positive: BOOLEAN
effective function
Is Current > 0 ?
is_negative: BOOLEAN
effective function
Is Current < 0 ?
factorial: NUMBER
effective function
infix "@=" (other: INTEGER_64): BOOLEAN
effective function
Is Current equal other ?
infix "//" (other: NUMBER): NUMBER
effective function
Divide Current by other (Integer division).
infix "@//" (other: INTEGER_64): NUMBER
effective function
Divide Current by other (Integer division).
infix "\\" (other: NUMBER): NUMBER
effective function
Remainder of division of Current by other.
infix "@\\" (other: INTEGER_64): NUMBER
effective function
Remainder of division of Current by other.
hash_code: INTEGER_32
effective function
The hash-code value of Current.
effective function
Great Common Divisor of Current and other.
infix "+" (other: NUMBER): NUMBER
deferred function
Sum of Current and other.
infix "-" (other: NUMBER): NUMBER
effective function
Difference of Current and other.
infix "*" (other: NUMBER): NUMBER
deferred function
Product of Current and other.
infix "/" (other: NUMBER): NUMBER
effective function
Quotient of Current and other.
infix "^" (exp: NUMBER): NUMBER
effective function
Current raised to exp-th power.
infix "<" (other: NUMBER): BOOLEAN
deferred function
Is Current strictly less than other?
infix "<=" (other: NUMBER): BOOLEAN
effective function
Is Current less or equal than other?
infix ">" (other: NUMBER): BOOLEAN
effective function
Is Current strictly greater than other?
infix ">=" (other: NUMBER): BOOLEAN
effective function
Is Current greater or equal than other?
prefix "+": NUMBER
frozen
effective function
Unary plus of Current.
prefix "-": NUMBER
deferred function
Opposite of Current.
is_integer_8: BOOLEAN
frozen
effective function
Does Current value fit on an INTEGER_8?
is_integer_16: BOOLEAN
frozen
effective function
Does Current value fit on an INTEGER_16?
is_integer_32: BOOLEAN
frozen
effective function
Does Current value fit on an INTEGER?
is_integer: BOOLEAN
frozen
effective function
is_integer_64: BOOLEAN
frozen
effective function
Does Current value fit on an INTEGER_64?
in_range (lower: NUMBER, upper: NUMBER): BOOLEAN
effective function
Return True if Current is in range [lower..upper]
compare (other: NUMBER): INTEGER_32
effective function
Compare Current with other.
three_way_comparison (other: NUMBER): INTEGER_32
effective function
Compare Current with other.
min (other: NUMBER): NUMBER
effective function
Minimum of Current and other.
max (other: NUMBER): NUMBER
effective function
Maximum of Current and other.
is_odd: BOOLEAN
effective function
Is odd ?
is_even: BOOLEAN
effective function
Is even ?
is_equal (other: NUMBER): BOOLEAN
deferred function
Is other attached to an object considered equal to current object?
is_integer_general_number: BOOLEAN
frozen
effective function
is_fraction_general_number: BOOLEAN
frozen
effective function
fit_real: BOOLEAN
frozen
effective function
to_integer_8: INTEGER_8
frozen
effective function
Conversion of Current in an INTEGER_8.
to_integer_16: INTEGER_16
frozen
effective function
Conversion of Current in an INTEGER_16.
to_integer_32: INTEGER_32
frozen
effective function
Conversion of Current in an INTEGER_32.
to_integer: INTEGER_32
frozen
effective function
to_integer_64: INTEGER_64
frozen
effective function
Conversion of Current in an INTEGER.
force_to_real_64: REAL_64
deferred function
Conversion of Current in a REAL_64.
to_string: STRING
frozen
effective function
Convert the NUMBER into a new allocated STRING.
to_unicode_string: UNICODE_STRING
frozen
effective function
Convert the NUMBER into a new allocated UNICODE_STRING.
append_in (buffer: STRING)
deferred procedure
Append the equivalent of to_string at the end of buffer.
append_in_unicode (buffer: UNICODE_STRING)
deferred procedure
Append the equivalent of to_unicode_string at the end of buffer.
to_string_format (s: INTEGER_32): STRING
frozen
effective function
Same as to_string but the result is on s character and the number is right aligned.
to_unicode_string_format (s: INTEGER_32): UNICODE_STRING
frozen
effective function
Same as to_unicode_string but the result is on s character and the number is right aligned.
append_in_format (str: STRING, s: INTEGER_32)
frozen
effective procedure
Append the equivalent of to_string_format at the end of str.
append_in_unicode_format (str: UNICODE_STRING, s: INTEGER_32)
frozen
effective procedure
Append the equivalent of to_unicode_string_format at the end of str.
to_decimal (digits: INTEGER_32, all_digits: BOOLEAN): STRING
frozen
effective function
Convert Current into its decimal view.
append_decimal_in (buffer: STRING, digits: INTEGER_32, all_digits: BOOLEAN)
deferred procedure
Append the equivalent of to_decimal at the end of buffer.
decimal_digit: CHARACTER
frozen
effective function
Gives the corresponding CHARACTER for range 0..9.
digit: CHARACTER
effective function
Gives the corresponding CHARACTER for range 0..9.
divisible (other: NUMBER): BOOLEAN
effective function
Is other a valid divisor for Current ?
one: NUMBER
once function
The neutral element of multiplication.
zero: NUMBER
once function
sign: INTEGER_8
frozen
effective function
Sign of Current (0 or -1 or 1).
sqrt: REAL_64
effective function
Compute the square routine.
log: REAL_64
frozen
effective function
abs: NUMBER
effective function
infix "@+" (other: INTEGER_64): NUMBER
deferred function
Sum of Current and other.
infix "@-" (other: INTEGER_64): NUMBER
effective function
Difference of Current and other.
infix "@*" (other: INTEGER_64): NUMBER
deferred function
infix "@/" (other: INTEGER_64): NUMBER
deferred function
Quotient of Current and other.
infix "@^" (exp: INTEGER_64): NUMBER
effective function
infix "@<" (other: INTEGER_64): BOOLEAN
deferred function
Is Current strictly less than other?
infix "@<=" (other: INTEGER_64): BOOLEAN
deferred function
Is Current less or equal other?
infix "@>" (other: INTEGER_64): BOOLEAN
deferred function
Is Current strictly greater than other?
infix "@>=" (other: INTEGER_64): BOOLEAN
deferred function
Is Current greater or equal than other?
infix "#=" (other: REAL_64): BOOLEAN
deferred function
Is Current equal other?
infix "#<" (other: REAL_64): BOOLEAN
deferred function
Is Current strictly less than other?
infix "#<=" (other: REAL_64): BOOLEAN
deferred function
Is Current less or equal other?
infix "#>" (other: REAL_64): BOOLEAN
deferred function
Is Current strictly greater than other?
infix "#>=" (other: REAL_64): BOOLEAN
deferred function
Is Current greater or equal than other?
out_in_tagged_out_memory
effective procedure
Append terse printable represention of current object in tagged_out_memory.
fill_tagged_out_memory
effective procedure
Append a viewable information in tagged_out_memory in order to affect the behavior of out, tagged_out, etc.
inverse: NUMBER
deferred function
deferred function
deferred function