Equations
- x.significand = x.frExp.fst
Instances For
Equations
- Float32.scale i x = x.scaleB i
Instances For
Equations
- Float32.encode (m, e) = (if m < 0 then Float32.neg else id) (Float32.ofBinaryScientific m.natAbs e)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- x.truncate = x.properFraction.fst
Instances For
Equations
- Float.scale i x = x.scaleB i
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- x.truncate = x.properFraction.fst
Instances For
Equations
- Printf.instRealFloat32 = { toOfInt := Printf.instOfIntFloat32, toNum := Printf.instNumFloat32, toNeg := instNegFloat32 }
Equations
- Printf.instRealFloat = { toOfInt := Printf.instOfIntFloat, toNum := Printf.instNumFloat, toNeg := instNegFloat }
Equations
- Printf.instFractionalFloat32 = { toNum := Printf.instNumFloat32, toOfInt := Printf.instOfIntFloat32, recip := fun (x : Float32) => 1 / x }
Equations
- Printf.instFractionalFloat = { toNum := Printf.instNumFloat, toOfInt := Printf.instOfIntFloat, recip := fun (x : Float) => 1 / x }
Equations
- Printf.instReprFFFormat = { reprPrec := Printf.reprFFFormat✝ }
Equations
- Printf.instBEqFFFormat = { beq := Printf.beqFFFormat✝ }
Equations
- Printf.instInhabitedFFFormat = { default := Printf.FFFormat.Exponent }
Equations
- add : a → a → a
- sub : a → a → a
- mul : a → a → a
- div : a → a → a
- neg : a → a
- recip : a → a
truncate x returns the integer nearest x between zero and x
Instances
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- Printf.Floating.logBase base x = Printf.Floating.log x / Printf.Floating.log base
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
- add : a → a → a
- sub : a → a → a
- mul : a → a → a
- div : a → a → a
- neg : a → a
- recip : a → a
- pi : a
- exp : a → a
- log : a → a
- sqrt : a → a
- sin : a → a
- cos : a → a
- tan : a → a
- asin : a → a
- acos : a → a
- atan : a → a
- sinh : a → a
- cosh : a → a
- tanh : a → a
- asinh : a → a
- acosh : a → a
- atanh : a → a
- reprPrec : a → Nat → Std.Format
- radix : Nat
The radix of the representation (often 2)
- digits : Nat
The number of digits of 'radix' in the significand
The lowest and highest values the exponent may assume
The function decodeFloat applied to a real floating-point number returns the significand expressed as an Integer and an appropriately scaled exponent (an Int). If decodeFloat x yields (m,n), then x is equal in value to m*b^n, where b is the floating-point radix, and furthermore, either m and n are both zero or else b^(d-1) <= abs m < b^d, where d is the value of RealFloat.digits x. In particular, decodeFloat 0 = (0,0). If the type contains a negative zero, also decodeFloat (-0.0) = (0,0) NOTE: The result of decodeFloat x is unspecified if either of isNaN x or isInfinite x is True.
encodeFloat performs the inverse of decodeFloat in the sense that for finite x with the exception of -0.0, uncurry encodeFloat (decodeFloat x) = x. encodeFloat m n is one of the two closest representable floating-point numbers to m*b^n (or ±Infinity if overflow occurs); usually the closer, but if m contains too many bits, the result may be rounded in the wrong direction.
- exponent : a → Int
- significand : a → a
- scale : Int → a → a
- isNaN : a → Bool
- isInfinite : a → Bool
- isFinite : a → Bool
- isNegative : a → Bool
- isNegativeZero : a → Bool
- isIEEE : Bool
Instances
Equations
- Printf.clamp x✝¹ x✝ = max (-x✝¹) (min x✝¹ x✝)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Based on "Printing Floating-Point Numbers Quickly and Accurately" by R.G. Burger and R.K. Dybvig in PLDI 96. This version uses a much slower logarithm estimator. It should be improved.
'floatToDigits' takes a base and a non-negative 'RealFloat' number, and returns a list of digits and an exponent.
In particular, if x >= 0, and floatToDigits base x = ([d1,d2,...,dn], e), then (1) @n >= 1@
(2) @x = 0.d1d2...dn * (base**e)@
(3) @0 <= di <= base-1@
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Printf.RealFloat.format.mk0 "" = "0"
- Printf.RealFloat.format.mk0 x✝ = x✝
Instances For
Equations
- Printf.showEFloat = (fun (x : f → String) => Printf.showString ∘ x) ∘ fun (dec? : Option Int) (self : f) => Printf.RealFloat.format Printf.FFFormat.Exponent dec? self
Instances For
Equations
- Printf.showFFloat alt = (fun (x : f → String) => Printf.showString ∘ x) ∘ fun (dec? : Option Int) (self : f) => Printf.RealFloat.format Printf.FFFormat.Fixed dec? self alt
Instances For
Equations
- Printf.showGFloat alt = (fun (x : f → String) => Printf.showString ∘ x) ∘ fun (dec? : Option Int) (self : f) => Printf.RealFloat.format Printf.FFFormat.Generic dec? self alt