Documentation

Printf.Classes.Floating

Equations
Instances For
    Equations
    Instances For
      Equations
      Instances For
        Equations
        Instances For
          Equations
          Instances For
            Equations
            Instances For
              def Float32.scale (i : Int) (x : Float32) :
              Equations
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Float32.truncate {b : Type u} [Printf.Integral b] (x : Float32) :
                    b
                    Equations
                    Instances For
                      Equations
                      Instances For
                        Equations
                        Instances For
                          Equations
                          Instances For
                            Equations
                            Instances For
                              Equations
                              Instances For
                                Equations
                                Instances For
                                  Equations
                                  Instances For
                                    def Float.scale (i : Int) (x : Float) :
                                    Equations
                                    Instances For
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          def Float.truncate {b : Type u} [Printf.Integral b] (x : Float) :
                                          b
                                          Equations
                                          Instances For
                                            Equations
                                            Instances For
                                              class Printf.Real (a : Type u) extends Printf.OfInt a, Printf.Num a, Neg a, Ord a, LT a, BEq a :
                                              Instances
                                                class Printf.Fractional (a : Type u) extends Printf.Num a, Printf.OfInt a :
                                                Instances
                                                  Instances For
                                                    class Printf.RealFrac (a : Type u) extends Printf.Real a, Printf.Fractional a :
                                                    Type (max (u + 1) (v + 1))
                                                    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.
                                                      • add : aaa
                                                      • sub : aaa
                                                      • mul : aaa
                                                      • div : aaa
                                                      • compare : aaOrdering
                                                      • lt : aaProp
                                                      • le : aaProp
                                                      • beq : aaBool
                                                      • ofInt : Inta
                                                      • recip : aa
                                                      • ofScientific (mantissa : Nat) (exponentSign : Bool) (decimalExponent : Nat) : a
                                                      • pi : a
                                                      • exp : aa
                                                      • log : aa

                                                        Natural Logarithm

                                                      • sqrt : aa
                                                      • sin : aa
                                                      • cos : aa
                                                      • tan : aa
                                                      • asin : aa
                                                      • acos : aa
                                                      • atan : aa
                                                      • sinh : aa
                                                      • cosh : aa
                                                      • tanh : aa
                                                      • asinh : aa
                                                      • acosh : aa
                                                      • atanh : aa
                                                      Instances
                                                        def Printf.Floating.logBase {f : Type u} [Floating f] (base x : f) :
                                                        f
                                                        Equations
                                                        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.
                                                          class Printf.RealFloat (a : Type u) extends Printf.RealFrac a, Printf.Floating a, Repr a, ToString a :
                                                          Type (max (u + 1) (u_1 + 1))
                                                          • ofInt : Inta
                                                          • add : aaa
                                                          • sub : aaa
                                                          • mul : aaa
                                                          • div : aaa
                                                          • compare : aaOrdering
                                                          • lt : aaProp
                                                          • le : aaProp
                                                          • beq : aaBool
                                                          • neg : aa
                                                          • recip : aa
                                                          • properFraction {b : Type u} [Integral b] : ab × a
                                                          • truncate {b : Type u_1} [Integral b] : ab
                                                          • round {b : Type u_1} [Integral b] : ab
                                                          • ceil {b : Type u_1} [Integral b] : ab
                                                          • floor {b : Type u_1} [Integral b] : ab
                                                          • ofScientific (mantissa : Nat) (exponentSign : Bool) (decimalExponent : Nat) : a
                                                          • pi : a
                                                          • exp : aa
                                                          • log : aa
                                                          • sqrt : aa
                                                          • sin : aa
                                                          • cos : aa
                                                          • tan : aa
                                                          • asin : aa
                                                          • acos : aa
                                                          • atan : aa
                                                          • sinh : aa
                                                          • cosh : aa
                                                          • tanh : aa
                                                          • asinh : aa
                                                          • acosh : aa
                                                          • atanh : aa
                                                          • reprPrec : aNatStd.Format
                                                          • radix : Nat

                                                            The radix of the representation (often 2)

                                                          • digits : Nat

                                                            The number of digits of 'radix' in the significand

                                                          • range : Int × Int

                                                            The lowest and highest values the exponent may assume

                                                          • decode : aInt × Int

                                                            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.

                                                          • encode : Int × Inta

                                                            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 : aInt
                                                          • significand : aa
                                                          • scale : Intaa
                                                          • isNaN : aBool
                                                          • isInfinite : aBool
                                                          • isFinite : aBool
                                                          • isNegative : aBool
                                                          • isNegativeZero : aBool
                                                          • isIEEE : Bool
                                                          Instances
                                                            def Printf.clamp :
                                                            IntIntInt
                                                            Equations
                                                            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.
                                                              @[inline]
                                                              def Printf.expt {b e p : Type u} [HPow b e p] (base : b) (n : e) :
                                                              p
                                                              Equations
                                                              Instances For
                                                                def Printf.RealFloat.toDigits {a : Type u} [RealFloat a] (base : Nat) (x : a) :

                                                                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
                                                                  partial def Printf.RealFloat.toDigits.fixup (base : Nat) (r : Int) (s mUp : Nat) (n : Int) :
                                                                  partial def Printf.RealFloat.toDigits.gen (base : Nat) (ds : List Int) (rn sN mUpN mDnN : Int) :
                                                                  def Printf.roundTo (base d : Int) (is : List Int) :
                                                                  Equations
                                                                  Instances For
                                                                    def Printf.roundTo.go (base b2 : Int) :
                                                                    IntBoolList IntInt × List Int
                                                                    Equations
                                                                    Instances For
                                                                      @[reducible, inline]
                                                                      Equations
                                                                      Instances For
                                                                        def Printf.RealFloat.format {f : Type u} [RealFloat f] (fmt : FFFormat) (dec? : Option Int) (self : f) (alt : Bool := false) :
                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          partial def Printf.RealFloat.format.doFmt (dec? : Option Int) (alt : Bool := false) (fmt : FFFormat) :
                                                                          def Printf.showEFloat {f : Type u} [RealFloat f] :
                                                                          Option IntfShowS
                                                                          Equations
                                                                          Instances For
                                                                            def Printf.showFFloat {f : Type u} [RealFloat f] (alt : Bool := false) :
                                                                            Option IntfShowS
                                                                            Equations
                                                                            Instances For
                                                                              def Printf.showGFloat {f : Type u} [RealFloat f] (alt : Bool := false) :
                                                                              Option IntfShowS
                                                                              Equations
                                                                              Instances For