Information générale
Catégorie:
Codage, syntaxe et commandes
>>PRB: Incorrect Evaluation of Equation with Variables (Q164359)
>>
>>The symptom is listed as:
>>
>>In Visual FoxPro 5.0, an equation that contains variables may not be evaluated correctly.
>>
>>I wonder what the heck that means. It sounds like my problem. But is the article saying that all equations with variables might give the wrong answer? Sounds like one hell of a bug!
>>
>I took a look since seeing this got me concerned (I do lots of statistical calculating). The bug that's shown in the KB article is too many (unneeded) parentheses in an equation, so we just have to watch it when we use them...that's not your problem, is it?
Are you sure you're looking at the same KB article? In the steps to reproduce they list a formula that containsa number of parenthesis, but it doesn't say that this is the only situation that produces the problem.
My problem is this: when my program runs, I have a line of code that is something like:
variable1 = variable2 * table.field
If variable2 = 0.04998, the value of table.field is 217.18, then I should get variable1 = 10.8546564. Instead I get variable1 = 10.8539997.
While my program is running, if I go to the command window and type variable2 = variable1 * 217.18 I also get the incorrect answer. But without the program running, if I type variable1 = 0.04998, variable2 = variable1 * 217.18, I get the correct answer.
I am unable to reproduce this by creating a new program.
Jeff
Précédent
Suivant
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