Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Streaming.h>
- void setup() {
- Serial.begin(115200);
- double f = 45.123456789;
- f = f*f;
- Serial << _DEC(f) << endl;
- char buffer[20];
- dtostrf(f,3,10,buffer); /* sprintf does not work with floats on Arduino */
- /* Outputs the full seven digits of precision from single-precision float f*/
- Serial.println(buffer);
- // for(byte b = 0; b < 20; b++){
- // Serial.write(buffer[b]);
- // }
- // Serial << endl;
- }
- void loop() {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement