Float
64-bit floating point numbers.
Constructor
Float accepts a float or an integer that can be represented exactly.
The lowercase float function performs numeric coercion and parsing:
Operators
Arithmetic
| Operator | Description | Result |
|---|---|---|
+ |
Addition | Float |
- |
Subtraction | Float |
* |
Multiplication | Float |
/ |
Division | Float |
// |
Euclidean (integer) division | Int |
% |
Euclidean remainder | Float |
-x |
Negation | Float |
// always returns an Int. // and % satisfy the identity
x == (x // y) * y + (x % y).
Comparison
==, !=, <, >, <=, >=
Mixed int/float comparisons are supported.