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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -