Go Down

Topic: floating point remark in the reference still true? (Read 521 times) previous topic - next topic

sk1p

The reference at http://www.arduino.cc/en/Reference/Float says:

Quote
Serial.println() truncates floats (throws away the fractions) into integers when sending serial. Multiply by power of ten to preserve resolution.


Is this still universally true? At least here it works just fine...

AlphaBeta

Quote
The reference at http://www.arduino.cc/en/Reference/Float says:

Quote
Serial.println() truncates floats (throws away the fractions) into integers when sending serial. Multiply by power of ten to preserve resolution.


Is this still universally true? At least here it works just fine...


It is actually partially still true.

It does not 'throw away the fractions', but it still truncates the float into two integer values. And prints a . between them.

paulb

#2
May 13, 2009, 06:44 am Last Edit: May 13, 2009, 06:46 am by paulb Reason: 1
Deleted, since we can print floats since v 014? In the next release we may even be able to set the precision of floating point numbers that we print.

See you don't know even know how good you got it. When I was a kid we had to get up and walk across the room to change the TV channel...

retrolefty

#3
May 13, 2009, 07:29 am Last Edit: May 13, 2009, 07:31 am by retrolefty Reason: 1
Quote
When I was a kid we had to get up and walk across the room to change the TV channel...


And we only received 3 channels and 2 of them had snow in the picture.

And Fortran or Cobal were the only high level choices. Anyone one remember those weird Fortran printer control characters you had to use at the start of print lines, yech.

Oh, and get off my lawn   ;D

Lefty


Go Up