Versions des environnements
>Yuri,
>
>it's a well known fact between mathematicians that multiplication should ALWAYS be done before a division in order to preserve the precision. One good example:
>1*3/3 = 3/3 =1.
>1/3*3 = 0.33333333333333333333333333333333*3=0.99999999999999999999999999999999
>
>>Thanks for the reply.
>>
>>Though I do not share your both opinions about parentheses or the multiplication should go first.
>>I see them as a workarounds similar to MTON that I used in my original post.
>>Not to mention that either you need to know in advance that you are dealing with the currency type, or you need to check the type in the code prior to process calculaltion
>>
>>From my point of view, it is a bug or at least a special "feature" that is not documented in VFP Help.
>>
>>Thanks
Trying to represent the problem and dealing with replyes, I eventually forgot the actual expression in the code where I discovered this behavior:
?fldcur * (n2/n1-1) && 7050.0000
?(n2/n1-1) * fldcur && 7050.0000
Looks like neither parentheses nor order of operations help here.
Précédent
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