fastspin CASE
ManAtWork
Posts: 2,262
in Propeller 2
Is CASE different in fastspin compared to P1 spin? I just tried to compile the FloatString library. It's plain spin so I thought it should also work on the P2. However,
If I replace it by
case exponent
'in range left of decimal
11..0:
AddDigits(exponent + 1)
'in range right of decimal
-1..digits - 13:
zeros := -exponent
AddDigits(1)
'out of range, do scientific notation
other:
DoScientific
always falls through to the "other" case no matter what the value of "exponent" is.If I replace it by
if exponent => 0 AND exponent < 12
AddDigits(exponent + 1)
elseif exponent < digits-13
DoScientific
else
zeros := -exponent
AddDigits(1)
it works as expected. Maybe the compiler has a problem with the left bound of "11..0" and "-1..digits-13" being higher than the right bound. I think it should throw an error if it can't cope with it.
Comments