Integer.st
changeset 11517 e949ec17d9fc
parent 11510 cea81c888454
child 11520 79ae7618543f
equal deleted inserted replaced
11516:6103c6e90a56 11517:e949ec17d9fc
  2201         denominator:d
  2201         denominator:d
  2202 
  2202 
  2203     "Modified: 28.7.1997 / 19:08:30 / cg"
  2203     "Modified: 28.7.1997 / 19:08:30 / cg"
  2204 !
  2204 !
  2205 
  2205 
       
  2206 differenceFromTimestamp:aTimestamp
       
  2207     "I am to be interpreted as seconds, return the timestamp this number of seconds
       
  2208      before aTimestamp"
       
  2209 
       
  2210     ^ aTimestamp subtractSeconds:self.
       
  2211 
       
  2212     "
       
  2213      Timestamp now subtractSeconds:100  
       
  2214      100 differenceFromTimestamp:Timestamp now 
       
  2215     "
       
  2216 !
       
  2217 
  2206 equalFromFraction:aFraction
  2218 equalFromFraction:aFraction
  2207     "that should never be invoked, as fractions are always normalized to integers
  2219     "that should never be invoked, as fractions are always normalized to integers
  2208      if resulting from an arithmetic operation.
  2220      if resulting from an arithmetic operation.
  2209      However, this implementation is for subclasses (i.e. fixed point) and also
  2221      However, this implementation is for subclasses (i.e. fixed point) and also
  2210      allows comparing unnormalized fractions as might appear within the fraction class"
  2222      allows comparing unnormalized fractions as might appear within the fraction class"
  3537     "
  3549     "
  3538 
  3550 
  3539     "Modified: 15.10.1997 / 18:43:49 / cg"
  3551     "Modified: 15.10.1997 / 18:43:49 / cg"
  3540 ! !
  3552 ! !
  3541 
  3553 
       
  3554 
  3542 !Integer methodsFor:'special bit operators'!
  3555 !Integer methodsFor:'special bit operators'!
  3543 
  3556 
  3544 bitAnd_32:anInteger
  3557 bitAnd_32:anInteger
  3545     "return a C-semantic 32bit locical-and of the receiver and
  3558     "return a C-semantic 32bit locical-and of the receiver and
  3546      the argument. Both must be either Small- or LargeIntegers.
  3559      the argument. Both must be either Small- or LargeIntegers.
  3953 ! !
  3966 ! !
  3954 
  3967 
  3955 !Integer class methodsFor:'documentation'!
  3968 !Integer class methodsFor:'documentation'!
  3956 
  3969 
  3957 version
  3970 version
  3958     ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.215 2009-02-03 09:53:58 cg Exp $'
  3971     ^ '$Header: /cvs/stx/stx/libbasic/Integer.st,v 1.216 2009-02-05 13:59:29 sr Exp $'
  3959 ! !
  3972 ! !
  3960 
  3973 
  3961 Integer initialize!
  3974 Integer initialize!