Skip to content

Commit

Permalink
Fix float parsing in GemStone.
Browse files Browse the repository at this point in the history
GemStone 3.7.2 changed the behavior of `1 raisedToInteger: -3` to return a fraction instead of a float. This update ensure that a float is returned.

This commit resolves dalehenrich/rb#12
  • Loading branch information
kurtkilpela committed Oct 17, 2024
1 parent bd10283 commit 36a6038
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ makeIntegerOrScaledInteger
neg
ifTrue: [integerPart := integerPart negated].
self readExponent
ifTrue: [^integerPart * (base raisedToInteger: exponent)].
ifTrue:
[^exponent negative "GemStone now returns a fraction instead of a float. We want a float for negative exponents."
ifTrue: [integerPart * (base asFloat raisedToInteger: exponent)]
ifFalse: [integerPart * (base raisedToInteger: exponent)]].
self readScale
ifTrue: [^integerPart asScaledDecimal: scale].
^ integerPart
^ integerPart

0 comments on commit 36a6038

Please sign in to comment.