Number.st
changeset 11458 d668f83e44d1
parent 11224 a9a66cee404f
child 11460 146fb82b5523
equal deleted inserted replaced
11457:5ff638783ee0 11458:d668f83e44d1
   806     ^ Complex real:self imaginary:aNumber
   806     ^ Complex real:self imaginary:aNumber
   807 
   807 
   808     "Modified: / 9.7.1998 / 10:18:12 / cg"
   808     "Modified: / 9.7.1998 / 10:18:12 / cg"
   809 !
   809 !
   810 
   810 
       
   811 +/- anError
       
   812     "return a MeasurementValue with the given error."
       
   813 
       
   814     ^ MeasurementValue value:self minValue:(self-anError) maxValue:(self+anError)
       
   815 
       
   816     "
       
   817      (100 +/- 5) * 2            
       
   818      (100 +/- 5) * (100 +/- 10)  
       
   819      (100 +/- 5) + (100 +/- 10)  
       
   820      (100 +/- 5) - (100 +/- 10)  
       
   821     "
       
   822 !
       
   823 
   811 @ aNumber
   824 @ aNumber
   812     "return a Point with the receiver as x-coordinate and the argument
   825     "return a Point with the receiver as x-coordinate and the argument
   813      as y-coordinate"
   826      as y-coordinate"
   814 
   827 
   815 %{  /* NOCONTEXT */
   828 %{  /* NOCONTEXT */
  1169      123 timesTwoPower:0  
  1182      123 timesTwoPower:0  
  1170      123 timesTwoPower:1  
  1183      123 timesTwoPower:1  
  1171      123 timesTwoPower:2  
  1184      123 timesTwoPower:2  
  1172      123 timesTwoPower:3  
  1185      123 timesTwoPower:3  
  1173     "
  1186     "
       
  1187 ! !
       
  1188 
       
  1189 !Number methodsFor:'measurement values'!
       
  1190 
       
  1191 maxValue
       
  1192     "the maximum possible value taking me as a measurement with possible error; 
       
  1193      as I am exact, thats myself"
       
  1194 
       
  1195     ^ self
       
  1196 !
       
  1197 
       
  1198 minValue
       
  1199     "the minimum possible value taking me as a measurement with possible error; 
       
  1200      as I am exact, thats myself"
       
  1201 
       
  1202     ^ self
  1174 ! !
  1203 ! !
  1175 
  1204 
  1176 !Number methodsFor:'printing & storing'!
  1205 !Number methodsFor:'printing & storing'!
  1177 
  1206 
  1178 printOn:aStream paddedWith:padCharacter to:size base:radix
  1207 printOn:aStream paddedWith:padCharacter to:size base:radix
  2150 ! !
  2179 ! !
  2151 
  2180 
  2152 !Number class methodsFor:'documentation'!
  2181 !Number class methodsFor:'documentation'!
  2153 
  2182 
  2154 version
  2183 version
  2155     ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.117 2008-10-19 11:12:39 cg Exp $'
  2184     ^ '$Header: /cvs/stx/stx/libbasic/Number.st,v 1.118 2009-01-14 22:06:10 cg Exp $'
  2156 ! !
  2185 ! !