Re: GFloat Rounding issue in DEC Basic V1.2-000
- From: "Neil Rieck" <n.rieck@xxxxxxxxxxxx>
- Date: Tue, 23 May 2006 06:41:02 -0400
"John Reagan" <john.reagan@xxxxxx> wrote in message
news:osncg.894$Vg6.807@xxxxxxxxxxxxxxxxxxx
Michael D. Ober wrote:
comparisons. Unfortunately I inherited this code and it's in a financial
payment module. I am obviously wary of breaking the code.
Please don't tell me that the code uses G_float to track currency!!!
Yikes!
I don't suspect any compiler bug, but have you tried the latest version
(V1.6)?
I don't think there is any way to turn hard comparisons into fuzzy
comparisons.
--
John Reagan
HP Pascal/{A|I}MACRO for OpenVMS Project Leader
Hewlett-Packard Company
More than 10 years ago I ran into similar problems in a financial
application and switched from FLOAT to DECIMAL (you need to make sure you
invoke OPTION DECIMAL ROUNDING). If it is not possible to rewrite your
application, you may need to switch from FLOAT to DECIMAL in certain places
prior to testing or comparison.
If you don't do this then you'll need to add all kinds of weird stuff like
"testing for negative 0" etc.
Neil Rieck
Kitchener/Waterloo/Cambridge,
Ontario, Canada.
http://www3.sympatico.ca/n.rieck/links/cool_openvms.html
http://www3.sympatico.ca/n.rieck/links/openvms_demos.html
.
- References:
- GFloat Rounding issue in DEC Basic V1.2-000
- From: Michael D. Ober
- Re: GFloat Rounding issue in DEC Basic V1.2-000
- From: Jeff Cameron
- Re: GFloat Rounding issue in DEC Basic V1.2-000
- From: Michael D. Ober
- Re: GFloat Rounding issue in DEC Basic V1.2-000
- From: John Reagan
- GFloat Rounding issue in DEC Basic V1.2-000
- Prev by Date: Re: MOSAIC / MOTIF bug (long pull down menus)
- Next by Date: Re: Carly Fiorina bio at wikipedia
- Previous by thread: Re: GFloat Rounding issue in DEC Basic V1.2-000
- Next by thread: Re: GFloat Rounding issue in DEC Basic V1.2-000
- Index(es):
Relevant Pages
|