Documentation

Init.Data.OfScientific

Precomputed values of 10 ^ e for 0 ≤ e ≤ 22. In this range, the values can be represented exactly.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    def Float.ofScientific (m : Nat) (s : Bool) (e : Nat) :
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[instance_reducible, defaultInstance 501]

      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
      @[export lean_float_of_nat]
      def Float.ofNat (n : Nat) :

      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
        Instances For
          @[instance_reducible]
          instance instOfNatFloat {n : Nat} :
          Equations
          @[reducible, inline]
          abbrev Nat.toFloat (n : Nat) :

          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

            Precomputed values of 10 ^ e for 0 ≤ e ≤ 10 . In this range, the values can be represented exactly.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Float32.ofScientific (m : Nat) (s : Bool) (e : Nat) :
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[instance_reducible]
                Equations
                @[export lean_float32_of_nat]

                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
                  Instances For
                    @[instance_reducible]
                    instance instOfNatFloat32 {n : Nat} :
                    Equations
                    @[reducible, inline]
                    abbrev Nat.toFloat32 (n : Nat) :

                    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