setFloatingPointClassification

setFloatingPointClassification(classification: Integer) updating;

The setFloatingPointClassification method of the Real primitive type sets the receiver to a special value specified by the classification parameter.

The following table lists valid values for the classification parameter (for which you can use a constant defined for the Real primitive type) and the special value that results.

classification Parameter Resultant Special Value for Receiver
FP_Classification_NegInfinity (2) Negative infinity.
FP_Classification_NotANumber (1) A Not a Number value. The result of an invalid operation; for example, attempting to find the square root of a negative number.
FP_Classification_PosInfinity (3) Positive infinity.

There are many possible Not a Number (NaN) representations. JADE returns a single NaN representation. A NaN does not compare equal to any floating-point number or NaN, even if the latter has an identical representation, as shown in the following code example.

vars   
    real : Real; 
begin    
    real.setFloatingPointClassification(Real.FP_Classification_NotANumber);
    write real = real;  // outputs false 
end;