floating point - How do I math on floats? -



floating point - How do I math on floats? -

this question has reply here:

is floating point math broken? 26 answers

i need alternative simple math.

float freqa = 28.333334; freqa = freqa+0.000001; println(freqa);

however results in 28.333336. how perform math right reply of 28.333335?

i have tried converting float integer performing math, converting float, same mathematical errors.

chances high programming environment has double datatype. type uses more memory float, offers higher precision.

https://en.wikipedia.org/wiki/double-precision_floating-point_format

floating-point

Comments

Popular posts from this blog

python - How to add an model instance to a django queryset? -

Using Android Volley to post an array to PHP -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -