Number.st
changeset 24971 8f4585ee27f8
parent 24959 aca1c02bc14a
child 24988 2b353bb8b70a
equal deleted inserted replaced
24970:ba5046061297 24971:8f4585ee27f8
  2086     "Modified (comment): / 01-06-2018 / 13:09:09 / Claus Gittinger"
  2086     "Modified (comment): / 01-06-2018 / 13:09:09 / Claus Gittinger"
  2087 !
  2087 !
  2088 
  2088 
  2089 ldexp:exp
  2089 ldexp:exp
  2090     "multiply the receiver by an integral power of 2.
  2090     "multiply the receiver by an integral power of 2.
  2091      I.e. return self * (2 ^ exp)"
  2091      I.e. return self * (2 ^ exp).
       
  2092      This is also the operation to reconstruct the original float from its
       
  2093      mantissa and exponent: (f mantissa ldexp:f exponent) = f"
  2092 
  2094 
  2093     ^ self * (2 raisedTo:exp)
  2095     ^ self * (2 raisedTo:exp)
  2094 
  2096 
  2095     "
  2097     "
  2096      1.0 ldexp:16  -> 65536.0
  2098      1.0 ldexp:16  -> 65536.0