In the stress testing model we have started to encounter problems due to finite precision, since we use double for the value of all contracts and as the unit of cash.
We run into problems whenever we perform comparisons, due to the accumulated errors from adding and subtracting quantities.
At the moment the most sensible solution would seem to be using int for the value of everything. Any better suggestions welcome!
In the stress testing model we have started to encounter problems due to finite precision, since we use
doublefor the value of all contracts and as the unit of cash.We run into problems whenever we perform comparisons, due to the accumulated errors from adding and subtracting quantities.
At the moment the most sensible solution would seem to be using
intfor the value of everything. Any better suggestions welcome!