The OfScientific Float must have priority higher than mid since
the default instance Neg Int has mid priority.
#check -42.0 -- must be Float
Equations
- instOfScientificFloat = { ofScientific := Float.ofScientific }
Converts a natural number into the closest-possible 64-bit floating-point number, or an infinite
floating-point value if the range of Float is exceeded.
Equations
Instances For
Converts an integer into the closest-possible 64-bit floating-point number, or positive or negative
infinite floating-point value if the range of Float is exceeded.
Equations
- Float.ofInt (Int.ofNat n) = Float.ofNat n
- Float.ofInt (Int.negSucc n) = (Float.ofNat n.succ).neg
Instances For
Equations
- instOfNatFloat = { ofNat := Float.ofNat n }
Converts a natural number into the closest-possible 64-bit floating-point number, or an infinite
floating-point value if the range of Float is exceeded.
Equations
- n.toFloat = Float.ofNat n
Instances For
Converts an integer into the closest-possible 64-bit floating-point number, or positive or negative
infinite floating-point value if the range of Float is exceeded.
Equations
- n.toFloat = Float.ofInt n
Instances For
Equations
- instOfScientificFloat32 = { ofScientific := Float32.ofScientific }
Converts a natural number into the closest-possible 32-bit floating-point number, or an infinite
floating-point value if the range of Float32 is exceeded.
Equations
Instances For
Converts an integer into the closest-possible 32-bit floating-point number, or positive or negative
infinite floating-point value if the range of Float32 is exceeded.
Equations
- Float32.ofInt (Int.ofNat n) = Float32.ofNat n
- Float32.ofInt (Int.negSucc n) = (Float32.ofNat n.succ).neg
Instances For
Equations
- instOfNatFloat32 = { ofNat := Float32.ofNat n }
Converts a natural number into the closest-possible 32-bit floating-point number, or an infinite
floating-point value if the range of Float32 is exceeded.
Equations
- n.toFloat32 = Float32.ofNat n
Instances For
Converts an integer into the closest-possible 32-bit floating-point number, or positive or negative
infinite floating-point value if the range of Float32 is exceeded.
Equations
- n.toFloat32 = Float32.ofInt n