Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MOD() Function
Message
De
25/10/1999 18:07:01
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
MOD() Function
Divers
Thread ID:
00281264
Message ID:
00281264
Vues:
54
I've just been reading an interesting article in the UK magazine PC Pro [December 99].

The writer, Jon Honeyball, was demonstrating that there is no independant proof that the numbers Excel generates are correct.

The example he used involved the mod function.

For example,

A = 112.932
B = 3.137

A - (B*INT(A/B)) = 0 - The correct answer

However, MOD(A,B) in Excel gives 1.77636E-15

OK, this is a small discrepancy, but he went on to say that

A MOD B in Visual Basic gives the answer 2. The help file for Visual Basic confirms that VB rounds A and B to integers before performing the calculation.

Needless to say, Visual FoxPro performs the calculation correctly and gives the answer 0.

Interesting.

Best.

Matt.
Répondre
Fil
Voir

Click here to load this message in the networking platform