[Glass] Fwd: '7.3470570000000004E+02' asNumber -> 7.3470570000000004E+00

Dale Henrichs dale.henrichs at gemtalksystems.com
Fri May 2 15:48:27 PDT 2014


[stupid gmail] ... in addition to the response below, I've submitted a bug
report[1] on this issue.

Dale

[1] https://github.com/glassdb/glass/issues/20

---------- Forwarded message ----------
From: Dale Henrichs <dale.henrichs at gemtalksystems.com>
Date: Fri, May 2, 2014 at 3:42 PM
Subject: Re: [Glass] '7.3470570000000004E+02' asNumber ->
7.3470570000000004E+00
To: Mariano Martinez Peck <marianopeck at gmail.com>


Not that this is a solution, but in pharo, you get the same answer as
GemStone (i.e., the exponent is ignored).... #asNumber is based on a port
of SqNumberParser, so that "makes sense."

This form of the printString produces the expected answer:

  '7.3470570000000004e02' asNumber.

Note the lower case $e and absence of $+ ...

With that said, I know that GemStone prints it's floats with a plus sign in
the exponent and this is a bug that has been fixed in 3.2 ...

SqNumberParser>>exponentLetters controls the list of exponents expected and
could be modified to include capital letters ...

The class ExtendedNumberParser will parse numbers with $+ in the exponent
so overriding SqNumberParser class>>on: to directly use
ExtendedNumberParser ... allows asNumber to accept $+ ,,,

so a patch to SqNumberParser>>exponentLetters and the SqNumber class-side
methods would probably get you past this hump...

Dale


On Fri, May 2, 2014 at 3:18 PM, Mariano Martinez Peck <marianopeck at gmail.com
> wrote:

> Terrible WTF or I am too tired?  note the +02 and the +00 ...
>
> thanks!
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20140502/d715bb8a/attachment-0001.html>


More information about the Glass mailing list