[8.6.1] Note to self - do not experiment with radix and exponent literals

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

[8.6.1] Note to self - do not experiment with radix and exponent literals

Richard Sargent
Administrator
2r1e110100 if evaluated will drag your system into the ground. If you use it where colour highlighting is active, it may never come back.

[I was curious if I could construct a concise literal representation of 2^52. So I first tried 2r1e52, which didn't die but did give me a Large Integer equal to 10^51 (I think). Then I *thought* - if you want to grace it with that term that a binary exponent would give me a different result. 52 in binary is 110100, so I think I must have ended up with 10^110099.]

Note to Instantiations - this should not be accepted. Excerpts from the ANSI standard:
float ::= mantissa [exponentLetter exponent]
mantissa ::= digits '.' digits
exponent ::= ['-']decimalInteger
exponentLetter ::= 'e' | 'd' | 'q'

integer ::= decimalInteger | radixInteger
decimalInteger ::= digits
digits ::= digit+
radixInteger ::= radixSpecifier 'r' radixDigits
radixSpecifier := digits
radixDigits ::= (digit | uppercaseAlphabetic)+

I think it should have been recognized as 2r1 e 110100 and produced a syntax error after the 'e', since 110100 isn't valid there.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.