Hi,
I am experiencing a strange behaviour.
When I use
Serial.print('\n');
Serial.print(123456987.54);
Serial.print('\0');
In serial monitor I get
123456984.00
What should I do if I need exact value as in my code?
Hi,
I am experiencing a strange behaviour.
When I use
Serial.print('\n');
Serial.print(123456987.54);
Serial.print('\0');
In serial monitor I get
123456984.00
What should I do if I need exact value as in my code?
Serial.print('\n');
Serial.print("123456987.54");
Serial.print('\0');
What should I do if I need exact value as in my code?
Adjust your expectations. A float has 6 or 7, not 11, digits of precision.
Is there NY way?
You could use fixed-point instead.
(Was it really too much trouble to type "any"?)
AWOL:
You could use fixed-point instead.
I am beginner. Can you explain about fixed point and how it will work?
I don't know if it will work for you, because I don't know what your definition of "work" is.
hamzaali:
Is there NY way?
Sure. Use a computer that has more than 32 bits for a float/double. Oh wait. That's a Wisconsin way, not a New York way.
Except for the physical sciences, very very few things in life require 11 significant figures of precision.
AWOL and PaulS if you can't help, then please stop posting irrelevent things.
gfvalvo, i am getting the value from equation. i tried to send it as int but no use. But thanks any way, now i know when to ditch it.
There's always the bignumber library I suppose.
Happy to oblige.
GypsumFantastic:
There's always the bignumber library I suppose.
Thanks I will try it out and let you know.