LimitedPrecisionReal.st
changeset 3898 818a12afad05
parent 3732 bf041aa09cc4
child 4455 2d31d0d986be
equal deleted inserted replaced
3897:b50a14f9083e 3898:818a12afad05
   276     ^ aNumber asFloat
   276     ^ aNumber asFloat
   277 
   277 
   278     "Modified: 17.4.1996 / 12:36:46 / cg"
   278     "Modified: 17.4.1996 / 12:36:46 / cg"
   279 !
   279 !
   280 
   280 
       
   281 fractionalPart
       
   282     "This has been renamed to #fractionPart for ST80 compatibility.
       
   283 
       
   284      extract the after-decimal fraction part.
       
   285      the floats value is 
       
   286         float truncated + float fractionalPart"
       
   287 
       
   288     self obsoleteMethodWarning:'please use #fractionPart'.
       
   289     ^ self fractionPart
       
   290 
       
   291     "Modified: / 28.10.1998 / 17:10:12 / cg"
       
   292     "Created: / 28.10.1998 / 17:10:32 / cg"
       
   293 !
       
   294 
   281 generality
   295 generality
   282     "return the generality value - see ArithmeticValue>>retry:coercing:"
   296     "return the generality value - see ArithmeticValue>>retry:coercing:"
   283 
   297 
   284     ^ 80
   298     ^ 80
   285 ! !
   299 ! !
   473     ^ self asFloat positive
   487     ^ self asFloat positive
   474 
   488 
   475     "Modified: 17.4.1996 / 13:35:10 / cg"
   489     "Modified: 17.4.1996 / 13:35:10 / cg"
   476 ! !
   490 ! !
   477 
   491 
   478 !LimitedPrecisionReal methodsFor:'truncation and rounding'!
       
   479 
       
   480 fractionPart
       
   481     "return a float with value from digits after the decimal point.
       
   482      (i.e. the receiver minus its truncated value)"
       
   483 
       
   484     ^ self - self truncated asFloat
       
   485 
       
   486     "
       
   487      1234.56789 fractionPart
       
   488      1.2345e6 fractionPart  
       
   489     "
       
   490 
       
   491     "Modified: 4.11.1996 / 20:26:54 / cg"
       
   492 !
       
   493 
       
   494 integerPart
       
   495     "return a float with value from digits before the decimal point
       
   496      (i.e. the truncated value)"
       
   497 
       
   498     ^ self truncated asFloat
       
   499 
       
   500     "
       
   501      1234.56789 integerPart 
       
   502      1.2345e6 integerPart   
       
   503     "
       
   504 
       
   505     "Modified: 4.11.1996 / 20:26:21 / cg"
       
   506 ! !
       
   507 
       
   508 !LimitedPrecisionReal class methodsFor:'documentation'!
   492 !LimitedPrecisionReal class methodsFor:'documentation'!
   509 
   493 
   510 version
   494 version
   511     ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.29 1998-08-05 12:30:03 cg Exp $'
   495     ^ '$Header: /cvs/stx/stx/libbasic/LimitedPrecisionReal.st,v 1.30 1998-10-28 16:18:22 cg Exp $'
   512 ! !
   496 ! !