-->
Page 1 of 3

32 bit or 64 bit integer precision?

PostPosted: Mon Aug 01, 2016 5:58 pm
by tma
Greetings,

I noticed that Serial.print does not support uint64_t variables which has me wondering if the math package supports 64 bit precision. Does anyone in this forum know the precision level of the math package?

Thanks in advance!

Re: 32 bit or 64 bit integer precision?

PostPosted: Mon Aug 01, 2016 9:20 pm
by martinayotte
I don't understand your question ...
Serial.print() is character based function.
Why it should be aware of uint64_t ?
Post your guilty code so that we can figure out ...

Re: 32 bit or 64 bit integer precision?

PostPosted: Wed Aug 03, 2016 2:59 pm
by tma
Greetings,
Thanks for your interest!

I understand Serial.println() prints ASCII characters but it automatically does the conversion for uint32_t, 32 bit integers. Since my post I noticed a posting of an alternate println library function that apparently will handle 64 bit integers.

You have me thinking that I should try an itoa conversion to a char array and then print the result. I am not sure if the itoa function works for 64 bit integers - possibly that is the problem.

BTW I would like to delete my other similar post under general discussions but do not know how to do that.

Thanks again!

Re: 32 bit or 64 bit integer precision?

PostPosted: Wed Aug 03, 2016 3:10 pm
by martinayotte
If you mean using "size_t println(unsigned long, int = DEC);", then there is no needs for something else.

But about your original question about uint64_t, did it failed to compile or not ?