Number.st
changeset 23479 c73c6affd861
parent 23323 fbc7256b2b0c
child 23480 4af396c83bb9
equal deleted inserted replaced
23478:33cb7a201308 23479:c73c6affd861
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1988 by Claus Gittinger
     2  COPYRIGHT (c) 1988 by Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
   358                 ].
   356                 ].
   359 
   357 
   360                 "/ if I am abstract (i.e. I am Number or LPReal),
   358                 "/ if I am abstract (i.e. I am Number or LPReal),
   361                 "/ let the exponent-character decide what kind of float we get:
   359                 "/ let the exponent-character decide what kind of float we get:
   362                 "/      qQ   -> LongFloat
   360                 "/      qQ   -> LongFloat
   363                 "/      eEdD -> Float      (which is iee-double)
   361                 "/      eEdD -> Float      (which is ieee-double)
   364                 "/      fF   -> ShortFloat (which is iee-float)
   362                 "/      fF   -> ShortFloat (which is ieee-float)
   365                 
   363                 
   366                 self isAbstract ifTrue:[
   364                 self isAbstract ifTrue:[
   367                     ('qQ' includes:expChar) ifTrue:[
   365                     ('qQ' includes:expChar) ifTrue:[
   368                         value := value asLongFloat.
   366                         value := value asLongFloat.
   369                     ] ifFalse:[
   367                     ] ifFalse:[
   474      DecimalPointCharactersForReading := #( $. ).
   472      DecimalPointCharactersForReading := #( $. ).
   475      Number readFrom:'99,00'
   473      Number readFrom:'99,00'
   476     "
   474     "
   477 
   475 
   478     "Modified: / 17-07-2017 / 15:18:03 / cg"
   476     "Modified: / 17-07-2017 / 15:18:03 / cg"
       
   477     "Modified (comment): / 27-10-2018 / 09:08:13 / Claus Gittinger"
   479 !
   478 !
   480 
   479 
   481 readFrom:aStringOrStream onError:exceptionBlock
   480 readFrom:aStringOrStream onError:exceptionBlock
   482     "return the next Number from the (character-)stream aStream;
   481     "return the next Number from the (character-)stream aStream;
   483      skipping all whitespace first; return the value of exceptionBlock,
   482      skipping all whitespace first; return the value of exceptionBlock,