64-bit fixed point numbers #
Equations
- instBEqFixed = { beq := instBEqFixed.beq }
Sentinel value, indicating we don't know what the number is
Equations
- instNanFixed = { nan := { n := Int64.minValue } }
We print Fixed s as an approximate floating point number
Equations
- instReprFixed = { reprPrec := fun (x : Fixed s) (x_1 : ℕ) => Std.Format.text x.toFloat.toStringFull }
-(-x) = x
Equations
- instInvolutiveNegFixed = { toNeg := instNegFixed, neg_neg := ⋯ }
Fixed approximates ℝ as an additive group
Equations
- One or more equations did not get rendered due to their size.
Order lemmas about nan #
If of_raw_uint128 ≠ nan, the input is small
theorem
Fixed.toNat_shiftLeftSaturate_of_ne_nan
{x : UInt128}
{s : UInt64}
{t : Int64}
(h : of_raw_uint128 (x.shiftLeftSaturate s) ≠ nan)
:
If we're not nan, shiftLeftSaturate is nice
We use the general .ofNat routine even for 1, to handle overflow,
rounding down arbitrarily
Equations
- Fixed.instOne = { one := Fixed.ofNat 1 false }
Conversion from ℕ literals to Fixed s
Equations
- instOfNatFixedOfAtLeastTwo = { ofNat := Fixed.ofNat n false }
@[irreducible]
Conversion from ℤ
Equations
- Fixed.ofInt n up = bif decide (n < 0) then -Fixed.ofNat (-n).toNat !up else Fixed.ofNat n.toNat up
Instances For
Fixed.ofNat rounds the desired way
Fixed.ofInt rounds the desired way
Fixed.ofRat rounds the desired way
Fixed.two_pow is correctly rounded
@[simp]
Fixed.log2 = nan if we're nonpos
@[simp]
Fixed.two_pow propagates nan
@[simp]
Fixed.repoint propagates nan
Equations
- x✝¹.decidableLT x✝ = id inferInstance
Equations
- x✝¹.decidableLE x✝ = id inferInstance
Equations
- One or more equations did not get rendered due to their size.