You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Up to 15 significant digits.
Double-precision floating-point format - Wikipedia, the free encyclopedia
Thank you for this information.
Then (if I understand it well) we can use (100000 have less than 15 significant digits):
but we cannot use:
because in this example _Point=0.00001 but this number could be represented by less or greater number than 0.00001 (e.g. 0.0000099999...) then we could get wrong result.
Of course, this also applies to your example.
If we want to be precise and don't use hard-coding numbers we have to use something like this:
For 5 digits symbols is _Point=0.00001 but it is represented by a little bit greater number. Then if you divide by _Point you don't get 100000 but 99999.99999... Then you have to add something (0.1 is enough) before you convert it to an integer.
UPDATE:
This also applies to 0, 1, 2, 3, 4 digits symbols. Then the general solution (IMHO) is: