How a composite arithmetic expression like A=(C-D)/(e+f) is evaluated in case the numbers are of mixed types?
If C is float (Double) and D,A are int, which type will be the intermediate C-D?
If C-D=.1, and e+f=.1, A=0 or A=1?
Otherwise a small rounding error can cause it to be 0 instead of 1.
Remember that decimal values cannot be accurately represented in a floating point value.
Thanks,
so that might have been the problem in my "attempt" to fit the BMP280 readings like 123456.89 into the OLED int 0-63 range...
I am coming from another Basic dialect (Bascom) that allows just one operation per line.
In that case, it is more obvious what happens though quite tedious to disentagle a more composite equation.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.