Re: GFloat Rounding issue in DEC Basic V1.2-000



"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


.



Relevant Pages

  • Re: Tech Needed: White Water optical sensor not working
    ... The ONLY switch that is not working is the 1 optical switch (Disaster ... test out, but I can't test the 2 chips, could these be ... If so, then yes, your 7 opto board would be suspect. ...
    (rec.games.pinball)
  • Re: Looking for a good float switch
    ... They both work on the same principle of a float with a magnet sliding ... I have made my switch myself. ... Simply got 6ft extension cord at Walmart for $1.50, lamp switch for $2 ... Other idea to use just two wire screws instead of a lamp switch :-) ...
    (rec.aquaria.marine.reefs)
  • Re: inline power function replacement
    ... static inline double ... switch ) ... multiple platforms leave yourself some space to switch implementations in ... You then need to use float, ...
    (comp.lang.c)
  • Re: Ademco Zone Type for Drain Pan
    ... | I picked up the small "float" switch from Ebay last week for less than ... | If you're interested in more details about the switch or the Ebay link, ... | Crash Gordon wrote: ...
    (alt.security.alarms)
  • Re: Adjustable sump pump switch assembly
    ... You say that dan fell down the old ... The switch looks like a standard pressure switch ... Your float rod goes ...
    (rec.crafts.metalworking)