Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why 1/2000000=0 is true ? BUG ?
Message
De
30/08/2003 18:42:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
30/08/2003 12:13:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00824749
Message ID:
00824867
Vues:
24
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform