FixedPoint.st
changeset 6570 1d115f1687e3
parent 6237 4dc908af4f5c
child 6573 4ea758ea3d4b
equal deleted inserted replaced
6569:f8336e46ec9f 6570:1d115f1687e3
   577      Transcript show:'fixed (exact)  : '; showCR:r.    
   577      Transcript show:'fixed (exact)  : '; showCR:r.    
   578      Transcript show:'fixed (scale2) : '; showCR:(r withScale:2).
   578      Transcript show:'fixed (scale2) : '; showCR:(r withScale:2).
   579 
   579 
   580      Transcript show:'float (inexact): '; showCR:(1 / 0.9999999).
   580      Transcript show:'float (inexact): '; showCR:(1 / 0.9999999).
   581     "
   581     "
       
   582 !
       
   583 
       
   584 negated
       
   585     "have to redefine it from Fraction"
       
   586 
       
   587     ^ self class 
       
   588         numerator:(numerator negated)
       
   589         denominator:denominator
       
   590         scale:scale
       
   591 !
       
   592 
       
   593 reciprocal
       
   594     "have to redefine it from Fraction"
       
   595 
       
   596     numerator == 1 ifTrue:[^ denominator].
       
   597     ^ self class 
       
   598         numerator:denominator
       
   599         denominator:numerator
       
   600         scale:scale
   582 ! !
   601 ! !
   583 
   602 
   584 !FixedPoint methodsFor:'coercing & converting'!
   603 !FixedPoint methodsFor:'coercing & converting'!
   585 
   604 
   586 asFixedPoint
   605 asFixedPoint
   904 ! !
   923 ! !
   905 
   924 
   906 !FixedPoint class methodsFor:'documentation'!
   925 !FixedPoint class methodsFor:'documentation'!
   907 
   926 
   908 version
   927 version
   909     ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.12 2001-11-27 17:30:54 cg Exp $'
   928     ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.13 2002-06-11 10:06:09 stefan Exp $'
   910 ! !
   929 ! !