on 8/30/01 21:28, john roberts at jarobe01 (AT) athena .DO.T louisville.edu wrote:
>> But if I write >> myVFloatField.SetString("123.45") >> s = myVFloatField.GetString >> >> and s is "123.46", then I don't find that funny. (Although >> "123.45000002563" would be perfectly acceptable, since that's the normal >> floating-point arithmethic problem). > > Hi, Frank. > > If you can live with the variation in representation then you are OK. I > didn't have a problem with it; however, some of the people I am working with > got very nervous with it. They don't mind what the computer does internally > however they don't want to see it. :)
Exactly,
not so far I have meet this problem once again, self.
when I write TEST project I have write something as:
if( fldDouble = 95.04 )
and this comparison did fail. I have track down this to C++ and have to see that 95.04 CAN NOT be stored in double value at all. It is always transformed to something close as 95.04000002
In fact such restrict languages as Pascal even do not allow us operators = and <> for double values. Only operators >, <, >=, <=
This is what about we are talking. If you think this is ok for you then...
Although I have see in past that for Money calculation exists special libs that implement special arithmetic that correctly round cents taking in account only 2 digits after dot...
-- Best regards, Ruslan Zasukhin
------------------------- Paradigma.
e-mail: ruslan@paradigmasoft.com web : http://www.paradigmasoft.com
To subscribe to the Valentina mail list send a letter to valentina-on (AT) lists .DO.T macserve.net ©2001 Ruslan Zasukhin |