Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does MOD() work?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00302170
Message ID:
00302182
Vues:
30
>From the VFP5 help file...
>
>? MOD(36,10) && Displays 6
>? MOD((4*9), (90/9)) && Displays 6
>? MOD(25.250,5.0) && Displays 0.250
>
>I agree with the first two but why does the last
>one display .250 when 25.25/5=5.05?
>
>Similarly ? mod(1999,4) displays 3 instead of 75.
>
>What am I missing?

MOD() returns the remainder of the first parameter when the largest integral multiple of the second parameter less than or equal to the first parameter is subtracted from it.

MOD(36,5) = 1
SET DECIMAL TO 9
MOD(PI(),3) = 0.141592654

It does not return the non-integer portion of division by the second parameter as you speculate.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform