Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why 1/2000000=0 is true ? BUG ?
Message
From
30/08/2003 18:42:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
30/08/2003 12:13:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00824749
Message ID:
00824867
Views:
25
>Hi Hilmar,
>
>i can write a SURE program with this numeric strange computations ?
>
>Mah ?!
>
>Fabio

Nothing is completely sure. Whatever data type you use, you must always be aware of its limitations. For instance, if you use Currency, you can't use more than 4 decimals. With Numeric, you can use more, but the last digits aren't completely safe.

I believe that in general, the handling VFP does of the data is safer than that in traditional programming languages like C or Pascal (although you can probably find special cases where the handling in C or Pascal is better). The special way comparisons are done have been introduced on purpose, to account for small inaccuracies in the general handling of floating-point numbers.

I do wish VFP had additional options. For instance, some languages offer BCD numbers - binary coded decimal, 2 digits per byte. In BCD, I understand, calculations like additions and subtractions are completely accurate, up to the accuracy supported.

My "large math" download supports numbers with any amount of digits - but it is relatively slow, compared with VFPs built-in handling of numbers - and it requires a special syntax to access the calculations.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform