Issue 3876 in pharo: SqNumberParserTest>>testFloatGradualUnderflow has an odd condition

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 3876 in pharo: SqNumberParserTest>>testFloatGradualUnderflow has an odd condition

pharo
Status: Accepted
Owner: [hidden email]
Labels: Importance-Low

New issue 3876 by [hidden email]:  
SqNumberParserTest>>testFloatGradualUnderflow has an odd condition
http://code.google.com/p/pharo/issues/detail?id=3876

SqNumberParserTest>>testFloatGradualUnderflow has an odd condition:

In the following code, note that #areLowercaseDigitsAllowed is expected to  
return nil or notNil:

        "Parse the number in base 16 if possible - it is impossible if lowercase  
letter are allowed digits
          due to exponent letter ambiguity."
    float := self areLowercaseDigitsAllowed
                ifNil: [SqNumberParser parse: '16r2.D2593D58B4FC4e-256']
                ifNotNil: [trueFraction asFloat].

but #areLowercaseDigitsAllowed returns true or false and in the 1.2 image  
it returns true ... implying that is impossible to parse?

As it stands the `trueFraction asFloat` expression is always executed ...  
I'm trying to port SqNumberParser to GemStone and this little section of  
code is misleading, especially considering that GemStone doesn't pass the  
test:)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3876 in pharo: SqNumberParserTest>>testFloatGradualUnderflow has an odd condition

pharo

Comment #1 on issue 3876 by [hidden email]:  
SqNumberParserTest>>testFloatGradualUnderflow has an odd condition
http://code.google.com/p/pharo/issues/detail?id=3876

Hmm, it sounds like a mistake, should be ifTrue:ifFalse: indeed.


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3876 in pharo: SqNumberParserTest>>testFloatGradualUnderflow has an odd condition

pharo

Comment #2 on issue 3876 by [hidden email]:  
SqNumberParserTest>>testFloatGradualUnderflow has an odd condition
http://code.google.com/p/pharo/issues/detail?id=3876

More exactly, ifFalse:ifTrue:

float := self areLowercaseDigitsAllowed
                ifFalse: [SqNumberParser parse: '16r2.D2593D58B4FC4e-256']
                ifTrue: [trueFraction asFloat].

because if lower case digits are allowed, then 16r2.D2593D58B4FC4e-256 is  
same as 16r2.D2593D58B4FC4E - 256


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3876 in pharo: SqNumberParserTest>>testFloatGradualUnderflow has an odd condition

pharo

Comment #3 on issue 3876 by [hidden email]:  
SqNumberParserTest>>testFloatGradualUnderflow has an odd condition
http://code.google.com/p/pharo/issues/detail?id=3876

aha, now it makes sense:)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3876 in pharo: SqNumberParserTest>>testFloatGradualUnderflow has an odd condition

pharo
Updates:
        Status: FixProposed

Comment #4 on issue 3876 by [hidden email]:  
SqNumberParserTest>>testFloatGradualUnderflow has an odd condition
http://code.google.com/p/pharo/issues/detail?id=3876

(No comment was entered for this change.)


Reply | Threaded
Open this post in threaded view
|

Re: Issue 3876 in pharo: SqNumberParserTest>>testFloatGradualUnderflow has an odd condition

pharo
Updates:
        Status: Closed

Comment #5 on issue 3876 by [hidden email]:  
SqNumberParserTest>>testFloatGradualUnderflow has an odd condition
http://code.google.com/p/pharo/issues/detail?id=3876

in 13111