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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement