Select Git revision
-
Fredrik Hübinette (Hubbe) authored
Rev: doc/types/float:1.4
Fredrik Hübinette (Hubbe) authoredRev: doc/types/float:1.4
float 947 B
NAME
float - floating point numbers
SYNTAX EXAMPLE
0.9
1.0
2.7e7
DESCRIPTION
This type stores a floating point number, normally it use 4 bytes
of storage when used in a global variable.
A list of operators that applies to floats follows:
In this list a and b is used to represent a float expression:
a + b summation
a - b subtraction
a * b multiplication
a / b division
a % b modulo ( same thing as a - floor( a / b ) * b )
- a negation
a == b return 1 if a is equal to b, 0 otherwise
a != b return 0 if a is equal to b, 1 otherwise
a < b returns 1 if a is lesser than b, 0 otherwise
a <= b returns 1 if a is lesser or equal to b, 0 otherwise
a > b returns 1 if a is greater than b, 0 otherwise
a >= b returns 1 if a is greater or equal to b, 0 otherwise
NOTA BENE
floats and ints cannot be used together, they have to be cast
to the same type first.
KEYWORDS
types
SEE ALSO
math/sin, math/cos, math/tan, math/sqrt