ShortFloat.st
changeset 24964 0236232a98e1
parent 24953 13bc1e8b12ab
child 24975 fdf3a5b2f6b6
equal deleted inserted replaced
24963:3f40782dfac4 24964:0236232a98e1
   507 
   507 
   508     E isNil ifTrue:[
   508     E isNil ifTrue:[
   509 	E := Float e asShortFloat
   509 	E := Float e asShortFloat
   510     ].
   510     ].
   511     ^ E
   511     ^ E
       
   512 !
       
   513 
       
   514 eBias
       
   515     "Answer the exponent's bias; 
       
   516      that is the offset of the zero exponent when stored"
       
   517 
       
   518     ^ 127
   512 !
   519 !
   513 
   520 
   514 emax
   521 emax
   515     "Answer the maximum exponent for this representation."
   522     "Answer the maximum exponent for this representation."
   516 
   523 
  1949 ! !
  1956 ! !
  1950 
  1957 
  1951 !ShortFloat methodsFor:'special access'!
  1958 !ShortFloat methodsFor:'special access'!
  1952 
  1959 
  1953 exponent
  1960 exponent
  1954     "extract a normalized float's exponent.
  1961     "extract a normalized float's (unbiased) exponent.
  1955      The returned value depends on the float-representation of
  1962      The returned value depends on the float-representation of
  1956      the underlying machine and is therefore highly unportable.
  1963      the underlying machine and is therefore highly unportable.
  1957      This is not for general use.
  1964      This is not for general use.
  1958      This assumes that the mantissa is normalized to
  1965      This assumes that the mantissa is normalized to
  1959      0.5 .. 1.0 and the float's value is mantissa * 2^exp"
  1966      0.5 .. 1.0 and the float's value is mantissa * 2^exp"