FixedPoint.st
changeset 6237 4dc908af4f5c
parent 5570 e6e14f50d721
child 6570 1d115f1687e3
equal deleted inserted replaced
6236:4747a2d1f2fd 6237:4dc908af4f5c
    27 since its superclass Fraction does all the work.
    27 since its superclass Fraction does all the work.
    28 
    28 
    29 Test: "''123456789012345678901234567890.123456789'' asFixed * 1000000000 = 123456789012345678901234567890123456789"
    29 Test: "''123456789012345678901234567890.123456789'' asFixed * 1000000000 = 123456789012345678901234567890123456789"
    30 
    30 
    31 Notes: 1) The current implementation does not convert arbitrarily-based String representations, 
    31 Notes: 1) The current implementation does not convert arbitrarily-based String representations, 
    32 	  which shouldn''t be too much a problem for financial types.'!
    32 	  which shouldn''t be too much a problem for financial types.'
       
    33 !
    33 
    34 
    34 !FixedPoint class methodsFor:'documentation'!
    35 !FixedPoint class methodsFor:'documentation'!
    35 
    36 
    36 copyright
    37 copyright
    37 "
    38 "
   151 
   152 
   152 "
   153 "
   153 ! !
   154 ! !
   154 
   155 
   155 !FixedPoint class methodsFor:'instance creation'!
   156 !FixedPoint class methodsFor:'instance creation'!
       
   157 
       
   158 numerator:n denominator:d 
       
   159     self shouldNotImplement. "use #numerator:denominator:scale"
       
   160     "/ ^ self numerator:n denominator:d scale:(d log max:n log) ceiling
       
   161 
       
   162     "
       
   163      self numerator:123 denominator:100    
       
   164     "
       
   165 !
   156 
   166 
   157 numerator:n denominator:d scale:s
   167 numerator:n denominator:d scale:s
   158     ^ self basicNew
   168     ^ self basicNew
   159         setNumerator:n
   169         setNumerator:n
   160         denominator:d
   170         denominator:d
   894 ! !
   904 ! !
   895 
   905 
   896 !FixedPoint class methodsFor:'documentation'!
   906 !FixedPoint class methodsFor:'documentation'!
   897 
   907 
   898 version
   908 version
   899     ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.11 2000-08-31 10:02:43 cg Exp $'
   909     ^ '$Header: /cvs/stx/stx/libbasic/FixedPoint.st,v 1.12 2001-11-27 17:30:54 cg Exp $'
   900 ! !
   910 ! !