Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MOD() - looks like a bug
Message
De
19/02/2002 20:05:39
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00621577
Message ID:
00622293
Vues:
22
>>What's wrong with mod() returning fractions?
>>Cetin
>
>It's that if you run say CertainRand(2,8) several times the chances are that on a certain run the function will indicate that MOD() returns, for example, 5.25 while arguments that it had were MOD(1145880599506199.0000,6). If you take this statement and execute it in the command window it returns the correct whole number. On the contrary, from within the function the result is a fraction.
>Regards.
>Kamil.

It is my understanding that mod() should return integers if the arguments are integers.

Perhaps there is a rounding error. I see that your number has 16 significant digits; the limit for numbers is between 15 and 16 digits. That is simply too much for VFP, IMO.

Hilmar.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform