Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How does MOD() work?
Message
 
À
10/12/1999 23:38:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00302170
Message ID:
00302174
Vues:
27
>>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?
>
>The modulo (MOD()) function returns the remainder, when the first argument is divided by the second. Just like the old way of doing long division by hand, that used to be taught in grade school.
>
>
>25.25 = (5 * 5.0) + 0.250
>1999 = (499 * 4) + 3
>
Sorry... It's late... I was just expecting the fractional part
of the division.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform