Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's wrong with VFP 5.0a's math (or is it me)?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00032141
Message ID:
00032284
Vues:
46
Jeff,

While this sounds onerous and ominous, it *does* also seem like someone has probably supplied the answer!

In your statements below you say:

>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.

Your previous message stated that the data is actually coming from another data source (SQL Server if I remember).
It certainly follows in my mind that there is a direct connection between *THAT* particular data and the behaviour observed. It would appear that the 'translation' of the data is consistent BUT not quite as expected.
I have no idea as to the exact translations performed, but would hope that it is documented somewhere. I'm betting that that is where the answer lies.

good luck,
Jim N
>>>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
Fil
Voir

Click here to load this message in the networking platform