Bug with RBParser

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

Bug with RBParser

MrGwen
Hi,

RBParser parseExpression: '2r100e2'
        results : 400 should be : 16

Cheers,
Gwenael Casaccio

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Bug with RBParser

Lukas Renggli
According to the ANSI standard integers do not support an exponent:

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

They even state explicitly that '10e10' is not a valid number token.

Furthermore floating point numbers do not accept a different radix (or
base) and thus are always written in decimal notation:

    float ::= mantissa [exponentLetter exponent]
    mantissa ::= digits '.' digits
    exponent ::= ['-']decimalInteger
    exponentLetter ::= 'e' | 'd' | 'q'

Cheers,
Lukas

On Wed, Feb 11, 2009 at 11:34 AM, Gwenael Casaccio <[hidden email]> wrote:

> Hi,
>
> RBParser parseExpression: '2r100e2'
>        results : 400 should be : 16
>
> Cheers,
> Gwenael Casaccio
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Bug with RBParser

MrGwen
On Wednesday 11 February 2009 12:08:44 Lukas Renggli wrote:
>  to the ANSI standard integers do not support an exponent:
>
>     integer ::= decimalInteger  | radixInteger
>     decimalInteger ::= digits
>     digits ::= digit+
>     radixInteger ::= radixSpecifier  'r' radixDigits
>     radixSpecifier := digits
>     radixDigits ::= (digit | uppercaseAlphabetic)+

Ok thanks for this explanation :) I didn't know but the problem is that some
classes use this notation ...

Cheers,
Gwenael Casaccio

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project