is_normal


Description:

[ CCode ( cname = "isnormal" ) ]
public bool is_normal ()

Determines if the given floating point number is normal, i.e. is neither zero, subnormal, infinite, nor NaN.

Example: Determines if the given floating point number is normal:

public static int main (string[] args) {
// Output: ``false``
float val = float.INFINITY;
print ("%s\n", val.is_normal ().to_string ());

// Output: ``false``
val = float.NAN;
print ("%s\n", val.is_normal ().to_string ());

// Output: ``true``
val = 0.3f;
print ("%s\n", val.is_normal ().to_string ());

// Output: ``true``
val = 0.3f;
print ("%s\n", val.is_normal ().to_string ());

// Output: ``true``
val = 1.0f;
print ("%s\n", val.is_normal ().to_string ());

return 0;
}

valac --pkg glib-2.0 -X -lm float.is_normal.vala