Hello

We are busy working, along with 3 others, on an estimation program: I'm using a 
lot of doubles, but also curruncies to present the calculated values to the 
user. (e.g. A *b * C * D = X  where a,b,c,d are doubles and X is of type 
currency)

Now a customer entered a 13- valued value and after doing some calculation the 
user recieves a resulting currency value, it shows a 'invalid floating point' 
error.(so the result is > MaxCurrency) Lowering one of the values will prevent 
this error, but I have to deal with these numbers.

I saw that the max value of currency is about  E+14 and double ~ E+308  . 

What is the neatest way to deal with calulated values that could result in an 
"invalid floating point" error. Do I have to limit all entries to a certain 
maximum, do I have to encapsulate all calculations with try except...?

Any structured way of dealing with these sort of values will be great. 
As these calculations are used in many parts of our program and the values 
provided to a user are being recalculated ad-hoc, using try except on all 
calculations (> 100,000,000) will put a great penalty on the performance.

I've done this in Excel and excel will show values > limit as somthing like " + 
#Value"  (i'm using the dutch version). The customer would like to be 
presented, I think, by a simular solution..

Any ideas?

Andries
The Netherlands





       
____________________________________________________________________________________
Get the free Yahoo! toolbar and rest assured with the added security of spyware 
protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php

[Non-text portions of this message have been removed]

Reply via email to