Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mod() function Bug?
Message
De
28/09/2006 12:11:17
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/09/2006 11:51:33
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01156435
Message ID:
01157882
Vues:
33
>OK, perhaps just a mention that the return when negative numbers are used will not be what you expect. By the way, is VB incorrect when it returns -1 or have they redefined the meaning of MOD to mean just the remainder when you divide by both negative and positive numbers?
>
>The definition in the VFP help file reads 'Divides one numeric expression by another numeric expression and returns the remainder.' I am not a math guy so I just believed the definition given and, therefore, I would expect MOD(-13,4) to return -1.

VB is not incorrect. It's their definition (as well as say C#'s). It's remainder as it says in C#, VFP doc lies IMHO:)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform