[Glass] Fwd: '7.3470570000000004E+02' asNumber -> 7.3470570000000004E+00
Dale Henrichs
dale.henrichs at gemtalksystems.com
Fri May 2 17:04:46 PDT 2014
I confirmed that it does fix the asNumber problem:
'7.3470570000000004E+02' asNumber -> 7.3470569999999998E+02
.... within roundoff error...presumably you would need to touch the other
`instance creation` methods in SqNumberParser to cover "all" of the bases
On Fri, May 2, 2014 at 4:54 PM, Mariano Martinez Peck <marianopeck at gmail.com
> wrote:
> Thank you very much guys. Tomorrow I send a detailed thanks but just to
> confirm that implementing:
>
> SqNumberParser class >> on: aStringOrStream
> ^ExtendedNumberParser new on: aStringOrStream
>
> SqNumberParser >> exponentLetters
> "answer the list of possible exponents for Numbers.
> Note: this parser will not honour precision attached to the exponent.
> different exponent do not lead to different precisions.
> only IEEE 754 floating point numbers will be created"
> ^'edqEDQ'
>
> Does solve the problem. I could now import my sixx data.
>
> Thanks!!!
>
>
>
> On Fri, May 2, 2014 at 7:48 PM, Dale Henrichs <
> dale.henrichs at gemtalksystems.com> wrote:
>
>> [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
>>>
>>>
>>
>>
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20140502/ab445a1b/attachment.html>
More information about the Glass
mailing list