Oso wrote:I presume I can mix types in calculations where it isn't an exact monetary amount, like...
No, you cannot do it. For example, 0.0001 on forex it is $0.05 on a minimum order. If you execute a hft, you won't be happy when the hysteresis created by a small error of 0.0001 will pump 50 mega$ per seconds. Low tide...
Even the double precision floating points are for the garbage, because the ratios, you think on start it is just to see, but, not.
A ratio, for 4 decimals, it is 12345, a strong integer. If you want to display it, you use Str(12345) and you insert a dot in the displayed string or you use plot, or displaySprite().
To get it from two values,
Code: Select all
ratio = a * 100000
rest = ratio % b
ratio / b
And you could even see the rest is useful.
I also bet nobody on this forum is able to display a amortization schedule with floating point numbers (single as double).
Don't forget also the price of petroleum was negative, 30 months ago : you could be payed to buy it, if you were able to buy it.
The precision of a floating point value, it is a joke. You can also try to build a string number system. It is slower, but it is a very good experience : to teach a computer to count.