float
Object Hierarchy:
Description:
[ SimpleType ]
public struct float
Example:
public static int main (string[] args) {
float f1 = 0.3f;
float f2 = 3.4f;
// Output: ``0.300000, 3.400000``
stdout.printf ("%f, %f\n", f1, f2);
return 0;
}
valac --pkg glib-2.0 float.vala
Content:
Static methods:
- public static float min (float a, float b)
- public static float max (float a, float b)
Methods:
- public bool is_nan ()
Determines if the given floating point number is not-a-number (NaN).
- public bool is_finite ()
Determines if the given floating point number has finite value i.e. it is
normal, subnormal or zero, but not infinite or NAN.
- public bool is_normal ()
Determines if the given floating point number is normal, i.e. is neither
zero, subnormal, infinite, nor NaN.
- public int is_infinity ()
Determines if the given floating point number is a negative or positive
infinity
- public string to_string (string format = "%g")
Similar to the standard C sprintf function but safer, since it
calculates the maximum space required and allocates memory to hold the result.
- public float clamp (float low, float high)
Fields:
- public static int MANT_DIG
Number of base FLT_RADIX digits that can be represented without
losing precision
- public static int DIG
Number of decimal digits that can be represented without losing precision
- public static int MIN_EXP
Minimum negative integer such that FLT_RADIX raised by power
one less than that integer is a normalized float
- public static int MAX_EXP
Maximum positive integer such that FLT_RADIX raised by power
one more than that integer is a normalized float
- public static int MIN_10_EXP
Minimum negative integer such that 10 raised by power one less than that
integer is a normalized float
- public static int MAX_10_EXP
Maximum positive integer such that 10 raised by power one more than that
integer is a normalized float
- public static float EPSILON
Difference between 1.0 and the next representable value for float
- public static float MIN
Minimum value of float
- public static float MAX
Maximum value of float
- public static float NAN
Indicates that the value is not-a-number (NaN)
- public static float INFINITY
Indicates that the value is not representable by the underlying type
(positive or negative infinity)