"Sputnik" help  
Sputnik Help
IsDenorm(<value>)

Description

Checks if a floating-point value is denormalized.

Parameters

<value> The floating-point value to check.

Return Value

Success: Returns true.
Failure: Returns false.

Remarks

This function checks if the given floating-point value is denormalized. Denormalized numbers have an exponent field of zero. It converts the double value to an unsigned 64-bit integer using the DoubleAsUInt64 function and performs a bitwise AND operation with the mask 0x7ff0000000000000ul. If the result is zero, indicating that the exponent field is zero, the function returns true. Otherwise, it returns false.

Related

Example

Example of usage:

my $value1 = 1.0;
my $isDenorm1 = IsDenorm($value1);
say $isDenorm1;

my $value2 = 0.0;
my $isDenorm2 = IsDenorm($value2);
say $isDenorm2;

my $value3 = 0.5;
my $isDenorm3 = IsDenorm($value3);
say $isDenorm3;

// PRINTS
// False
// True
// False

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org