float printing

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

float printing

otto
Hi,

We are trying to printString Floats and are trying using
asStringUsingFormat. Is this the right method to use in GS?

If so, it behaves a bit inconsistently in 3.0 Beta5.

0.001 asStringUsingFormat: #(0 16 false)  gives us  '0.001', but
0.000000001 asStringUsingFormat: #(0 16 false) gives us '1E-09'.

It behaved consistently in 2.4.4.4.

Can you please help?

Thanks
Otto
Reply | Threaded
Open this post in threaded view
|

Re: float printing

James Foster-8
I've submitted a bug report for this (#41668) but I don't expect that it will be fixed in 3.0.0 (which is pretty far in the release process).

James

On Jun 21, 2011, at 6:15 AM, Otto Behrens wrote:

> Hi,
>
> We are trying to printString Floats and are trying using
> asStringUsingFormat. Is this the right method to use in GS?
>
> If so, it behaves a bit inconsistently in 3.0 Beta5.
>
> 0.001 asStringUsingFormat: #(0 16 false)  gives us  '0.001', but
> 0.000000001 asStringUsingFormat: #(0 16 false) gives us '1E-09'.
>
> It behaved consistently in 2.4.4.4.
>
> Can you please help?
>
> Thanks
> Otto

Reply | Threaded
Open this post in threaded view
|

Re: float printing

Dale Henrichs
In reply to this post by otto
Otto,

As James mentioned a bugfix won't make it into 3.0 since the 3.0 release is already in the pipeline.

The bugfix for the primitive should be in a follow on release of 3.0...

BTW, the internal bug number is: 'BUG #41668 (GemStone/S 64): SmallDouble>>#'asStringUsingFormat:' uses exponent notation when it should not' so you can check in the release notes ...

Thanks for the report.

Dale

----- Original Message -----
| From: "Otto Behrens" <[hidden email]>
| To: "GemStone Seaside beta discussion" <[hidden email]>
| Sent: Tuesday, June 21, 2011 6:15:58 AM
| Subject: [GS/SS Beta] float printing
|
| Hi,
|
| We are trying to printString Floats and are trying using
| asStringUsingFormat. Is this the right method to use in GS?
|
| If so, it behaves a bit inconsistently in 3.0 Beta5.
|
| 0.001 asStringUsingFormat: #(0 16 false)  gives us  '0.001', but
| 0.000000001 asStringUsingFormat: #(0 16 false) gives us '1E-09'.
|
| It behaved consistently in 2.4.4.4.
|
| Can you please help?
|
| Thanks
| Otto
|
Reply | Threaded
Open this post in threaded view
|

Re: float printing

Ivan, Liliana
Hi James, Dale
Is there a workaround we can use in meanwhile?

Thanks
Liliana

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Dale Henrichs
Sent: 21 June 2011 23:54
To: GemStone Seaside beta discussion
Subject: Re: [GS/SS Beta] float printing

Otto,

As James mentioned a bugfix won't make it into 3.0 since the 3.0 release is already in the pipeline.

The bugfix for the primitive should be in a follow on release of 3.0...

BTW, the internal bug number is: 'BUG #41668 (GemStone/S 64): SmallDouble>>#'asStringUsingFormat:' uses exponent notation when it should not' so you can check in the release notes ...

Thanks for the report.

Dale

----- Original Message -----
| From: "Otto Behrens" <[hidden email]>
| To: "GemStone Seaside beta discussion" <[hidden email]>
| Sent: Tuesday, June 21, 2011 6:15:58 AM
| Subject: [GS/SS Beta] float printing
|
| Hi,
|
| We are trying to printString Floats and are trying using
| asStringUsingFormat. Is this the right method to use in GS?
|
| If so, it behaves a bit inconsistently in 3.0 Beta5.
|
| 0.001 asStringUsingFormat: #(0 16 false)  gives us  '0.001', but
| 0.000000001 asStringUsingFormat: #(0 16 false) gives us '1E-09'.
|
| It behaved consistently in 2.4.4.4.
|
| Can you please help?
|
| Thanks
| Otto
|

This e-mail is subject to a disclaimer, available at http://www.rmb.co.za/web/elements.nsf/online/disclaimer-communications.html
Reply | Threaded
Open this post in threaded view
|

Re: float printing

Dale Henrichs
Liliana,

The printing code is in C, so there's no easy/direct fix. Have you looked at alternatives like:

  Number>>printShowingDecimalPlaces:

and friends for inspiration?

Dale

----- Original Message -----
| From: "Liliana Ivan" <[hidden email]>
| To: "GemStone Seaside beta discussion" <[hidden email]>
| Sent: Wednesday, June 22, 2011 1:25:03 AM
| Subject: Re: [GS/SS Beta] float printing
|
| Hi James, Dale
| Is there a workaround we can use in meanwhile?
|
| Thanks
| Liliana
|
| -----Original Message-----
| From: [hidden email]
| [mailto:[hidden email]] On Behalf Of Dale
| Henrichs
| Sent: 21 June 2011 23:54
| To: GemStone Seaside beta discussion
| Subject: Re: [GS/SS Beta] float printing
|
| Otto,
|
| As James mentioned a bugfix won't make it into 3.0 since the 3.0
| release is already in the pipeline.
|
| The bugfix for the primitive should be in a follow on release of
| 3.0...
|
| BTW, the internal bug number is: 'BUG #41668 (GemStone/S 64):
| SmallDouble>>#'asStringUsingFormat:' uses exponent notation when it
| should not' so you can check in the release notes ...
|
| Thanks for the report.
|
| Dale
|
| ----- Original Message -----
| | From: "Otto Behrens" <[hidden email]>
| | To: "GemStone Seaside beta discussion" <[hidden email]>
| | Sent: Tuesday, June 21, 2011 6:15:58 AM
| | Subject: [GS/SS Beta] float printing
| |
| | Hi,
| |
| | We are trying to printString Floats and are trying using
| | asStringUsingFormat. Is this the right method to use in GS?
| |
| | If so, it behaves a bit inconsistently in 3.0 Beta5.
| |
| | 0.001 asStringUsingFormat: #(0 16 false)  gives us  '0.001', but
| | 0.000000001 asStringUsingFormat: #(0 16 false) gives us '1E-09'.
| |
| | It behaved consistently in 2.4.4.4.
| |
| | Can you please help?
| |
| | Thanks
| | Otto
| |
|
| This e-mail is subject to a disclaimer, available at
| http://www.rmb.co.za/web/elements.nsf/online/disclaimer-communications.html
|
Reply | Threaded
Open this post in threaded view
|

Re: float printing

Martin McClure-3
In reply to this post by Ivan, Liliana
On 06/22/2011 01:25 AM, Ivan, Liliana wrote:
> Hi James, Dale
> Is there a workaround we can use in meanwhile?

One workaround would be to convert the binary float to a DecimalFloat
before printing:

0.000000001 asDecimalFloat asStringUsingFormat: #(0 16 false)

I haven't looked at the corner cases of rounding and such, but this
should give good answers for most cases.

Regards,

-Martin

>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Dale Henrichs
> Sent: 21 June 2011 23:54
> To: GemStone Seaside beta discussion
> Subject: Re: [GS/SS Beta] float printing
>
> Otto,
>
> As James mentioned a bugfix won't make it into 3.0 since the 3.0 release is already in the pipeline.
>
> The bugfix for the primitive should be in a follow on release of 3.0...
>
> BTW, the internal bug number is: 'BUG #41668 (GemStone/S 64): SmallDouble>>#'asStringUsingFormat:' uses exponent notation when it should not' so you can check in the release notes ...
>
> Thanks for the report.
>
> Dale
>
> ----- Original Message -----
> | From: "Otto Behrens"<[hidden email]>
> | To: "GemStone Seaside beta discussion"<[hidden email]>
> | Sent: Tuesday, June 21, 2011 6:15:58 AM
> | Subject: [GS/SS Beta] float printing
> |
> | Hi,
> |
> | We are trying to printString Floats and are trying using
> | asStringUsingFormat. Is this the right method to use in GS?
> |
> | If so, it behaves a bit inconsistently in 3.0 Beta5.
> |
> | 0.001 asStringUsingFormat: #(0 16 false)  gives us  '0.001', but
> | 0.000000001 asStringUsingFormat: #(0 16 false) gives us '1E-09'.
> |
> | It behaved consistently in 2.4.4.4.
> |
> | Can you please help?
> |
> | Thanks
> | Otto
> |
>
> This e-mail is subject to a disclaimer, available at http://www.rmb.co.za/web/elements.nsf/online/disclaimer-communications.html