`float`

A **float** — that is, an IEEE 754 single-precision floating point number — is an approximation of a real number. The representation uses 32 bits, organized as 1 sign bit, 23 bits of mantissa, and 8 bits of exponent. Finite `float`

values range from `-3.40282347e+38`

to `3.40282347e+38`

. The closest to zero nonzero `float`

values are `±1.40239846e-45`

. Positive zero (`0.0`

) and negative zero (`-0.0`

) are considered distinct. Infinities are supported, but indicate an overflow of representational limits (rather than `±∞`

). Some values are `NaN`

s. No two differing `NaN`

encodings are considered equal.

In Avail, a literal float comprises one or more decimal digits, then a *full stop* `.`

`(U+002E)`

and fractional part, then optional exponential notation — an `E`

`(U+0045)`

or `e`

`(U+0065)`

followed by one or more decimal digits — and finally `f`

`(U+0066)`

. Examples include `1.0`

, `0.1`

, `0.0025`

, `2.5E-3`

, `2500.0`

, `2.5E3`

, and `3.141592653589793`

. Literal floats are defined by the macros `"…#.…#«f»?"`

, `"…#.…#…"`

, and `"…#.…#e|E«+|-»!…#«f»?"`

.

The `float`

type is provided only for interoperation with the Java programming language. Use of `float`

values is generally discouraged; prefer `double`

values whenever possible.

‹ `double` |
| | Return to Type System | | | `extended integer` › |