An IEEE binary32 value kept as 32 bits.
bits is an integer from 0 to 0xFFFFFFFF. 0x3F800000 is 1.0.
Elixir's float is binary64. to_float/1 widens a finite value. A
non-finite pattern raises MatchError because this runtime rejects
those bit patterns. The default array view does not call to_float/1.
Summary
Functions
Widens float32 to an Elixir float.
Types
@type t() :: %ASDF.Float32{bits: non_neg_integer()}
One binary32 value.
:bits— the 32-bit pattern,0..0xFFFFFFFF
Functions
Widens float32 to an Elixir float.
float32 is an %ASDF.Float32{} whose :bits fit in 32 bits. Finite
values return a float. Infinity and NaN raise MatchError.
Examples
iex> ASDF.Float32.to_float(%ASDF.Float32{bits: 0x3F800000})
1.0
iex> ASDF.Float32.to_float(%ASDF.Float32{bits: 0xC0000000})
-2.0