[operations] [attributes] [fields] [template] [definition]
[implementation] [documentation]
To use the search tool you need to use a browser which supports JAVA (c)

[next] [prev] [superclass] [next peer] [prev peer] [subclass] [index] [hierarchy]

FloatingPoint

inherits from Object

Object <- FloatingPoint



Operations

Get list of all operations

DoubleFromNumeral
FormatDoubleIntoNumberParts
IsInf
IsNaN
NumeralFromDouble
NumeralFromDoubleControlled
NumeralFromDoubleSeparateExponent
Pi
ReinitializeClass
ScanDoubleFromNumberParts
SetToInf
SetToNaN


Attributes

Get list of all attributes

Class FloatingPoint defines no new attributes.


Fields

No fields are defined by FloatingPoint or any of its superclasses.


Instance template

instance FloatingPoint tag;
end instance;

Class definition

Define Class FloatingPoint;
    inherits from Object;
#ifdef PROCESSOR_MIPS
    overrides ReinitializeClass;
#endif

    // localizable formatting operations

    intrinsic NumeralFromDouble(number: Double; maxDigits: Unsigned): Text;
        // returns a new transient text object representing number in the
        // localized default format in at most maxDigits.
        // punctuation does not count towards maxDigits
        // uses normal format if number fits in maxDigits, scientific format otherwise
    intrinsic NumeralFromDoubleControlled(number: Double; maxDigits: Unsigned;
                maxPrecision: Unsigned; minSignificantDigits: Unsigned; formatFlags: Unsigned): Text;
        // returns a new transient text object representing number in a localized format
        // in at most maxDigits and with at most maxPrecision digits after the decimal separator.
        // Pass ULONG_MAX for maxDigits or maxPrecision to get maximum supported by floating point system.
        // By default uses normal format if number fits in maxDigits, scientific format otherwise, flags may override.
        // In case of negative exponents (cramped fractions) uses scientific format only if requested.
        // Values for formatFlags are defined in Numbers.h.
        // Punctuation does not count towards maxDigits.
        // Rounding behavior is implementation dependent.
    intrinsic NumeralFromDoubleSeparateExponent(number: Double; maxDigits: Unsigned;
                maxPrecision: Unsigned; minSignificantDigits: Unsigned; formatFlags: Unsigned;
                var mantissaText: Text; var exponentText: Text);
        // returns separate text objects for mantissaText and exponentText
        // for clients that need to display them separately
        // otherwise similar to NumeralFromDoubleControlled.
        // returns nil for exponentText if no exponent needed.

    // localizable scanning operations

    intrinsic DoubleFromNumeral(numeral: HasText; var result: Double): Unsigned;

    // basic support for formatting and scanning

    intrinsic FormatDoubleIntoNumberParts(number: Double; maxDigits: Unsigned;
                maxPrecision: Unsigned; minSignificantDigits: Unsigned; formatFlags: Unsigned;
                var theNumberParts: NumberParts): Boolean;
    intrinsic ScanDoubleFromNumberParts(theNumberParts: NumberParts; var result: Double): Boolean;

    // some real Math operations

    intrinsic IsInf(maybeInf: Double): Boolean;
    intrinsic IsNaN(maybeNaN: Double): Boolean;
    intrinsic SetToNaN(var nan: Double);
    intrinsic SetToInf(var inf: Double);
    intrinsic Pi(): Double;
end class;