Pages: [1]   Go Down
Author Topic: floating point remark in the reference still true?  (Read 490 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 13
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 267
dinosaur cork
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
« Last Edit: May 12, 2009, 11:46:16 pm by paulb » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17294
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

« Last Edit: May 13, 2009, 12:31:17 am by retrolefty » Logged

Pages: [1]   Go Up
Jump to: