ArduinoCore-sam icon indicating copy to clipboard operation
ArduinoCore-sam copied to clipboard

Arduino Zero (SAM) SerialUSB.print(-2147483648);

Open avandalen opened this issue 7 years ago • 1 comments

Printing at the Arduino Zero (SAM) gives an error with:

SerialUSB.print(-2147483648);

Error message: exit status 1 call of overloaded 'print(long long int)' is ambiguous

This goes well: int s = -2147483648; SerialUSB << s << endl;

avandalen avatar Aug 03 '16 08:08 avandalen

Arduino Zero (SAM)

SAMD actually.

The type of -2147483648 is long long int, because 2147483648 does not fit into int or long int. The sign is not part of the constant, but an unary operator. There is no print(long long int) in the Print class.

oqibidipo avatar Aug 03 '16 09:08 oqibidipo