Hide minor edits - Show changes to output

September 14, 2012, at 11:29 PM
by

- Changed lines 5-7 from:

Unsigned ints (unsigned integers) are the same as ints in

that they store a 2 byte value. Instead of storing negative numbers however they only store positive values, yielding a useful range of 0 to 65,535 (2^16) - 1).

that they store a 2 byte value. Instead of storing negative numbers however they only store positive values, yielding a useful range of 0 to 65,535 (2^16) - 1).

to:

On the Uno and other ATMEGA based boards, unsigned ints (unsigned integers) are the same as ints in that they store a 2 byte value. Instead of storing negative numbers however they only store positive values, yielding a useful range of 0 to 65,535 (2^16) - 1).

The Due stores a 4 byte (32-bit) value, ranging from 0 to 4,294,967,295 (2^32 - 1).

The Due stores a 4 byte (32-bit) value, ranging from 0 to 4,294,967,295 (2^32 - 1).

June 25, 2009, at 01:03 PM
by

- Changed lines 37-38 from:

* [[unsigned long]]

to:

* [[unsigned long]]

* [[http://arduino.cc/en/Reference/VariableDeclaration|Variable Declaration]]

* [[http://arduino.cc/en/Reference/VariableDeclaration|Variable Declaration]]

May 06, 2008, at 06:51 AM
by

- Changed lines 12-13 from:

[=int ledPin = 13;=]

to:

[=unsigned int ledPin = 13;=]

Changed lines 16-18 from:

[=int var = val;=]

*var - your int variable name

*var - your int variable name

to:

[= unsigned int var = val;=]

*var - your unsigned int variable name

*var - your unsigned int variable name

May 27, 2007, at 03:51 AM
by

- Changed lines 8-9 from:

The difference lies in the way the highest bit, sometimes refered to as the "sign" bit is interpreted. In the Arduino int type (which is signed), if the high bit is a "1", the number is interpreted as a negative number, and the other 15 bits are interpreted with [[http://en.wikipedia.org/wiki/2%27s_complement | 2's complement math.]]

to:

The difference between unsigned ints and (signed) ints, lies in the way the highest bit, sometimes refered to as the "sign" bit, is interpreted. In the Arduino int type (which is signed), if the high bit is a "1", the number is interpreted as a negative number, and the other 15 bits are interpreted with [[http://en.wikipedia.org/wiki/2%27s_complement | 2's complement math.]]

May 18, 2007, at 05:41 AM
by

- Changed lines 8-9 from:

The difference lies in the way the highest bit, sometimes refered to as the "sign" bit is interpreted. In the Arduino int type, which is signed, if the high bit is a "1", the number is interpreted as a negative number and the other 15 bits are interpreted with [[http://en.wikipedia.org/wiki/2%27s_complement | 2's complement math.]]

to:

The difference lies in the way the highest bit, sometimes refered to as the "sign" bit is interpreted. In the Arduino int type (which is signed), if the high bit is a "1", the number is interpreted as a negative number, and the other 15 bits are interpreted with [[http://en.wikipedia.org/wiki/2%27s_complement | 2's complement math.]]

May 18, 2007, at 05:39 AM
by

- Changed lines 8-9 from:

The difference lies in the way the highest bit, sometimes refered to as the "sign" bit is interpreted. In the Arduino int type, if the high bit is a "1", the number is interpreted as a negative number and the other 15 bits are interpreted with [[http://en.wikipedia.org/wiki/2%27s_complement | 2's complement math.]]

to:

The difference lies in the way the highest bit, sometimes refered to as the "sign" bit is interpreted. In the Arduino int type, which is signed, if the high bit is a "1", the number is interpreted as a negative number and the other 15 bits are interpreted with [[http://en.wikipedia.org/wiki/2%27s_complement | 2's complement math.]]

April 25, 2007, at 12:52 AM
by

- April 17, 2007, at 12:09 AM
by

- not sure that unsigned int x = 65536; does what you expect (constant are signed ints, I believe)Deleted lines 28-29:

x = 65535;

April 17, 2007, at 12:08 AM
by

- Changed lines 14-15 from:

!!!!Parameters

to:

!!!!Syntax

Changed lines 34-36 from:

to:

!!!!See Also

* [[byte]]

* [[int]]

* [[long]]

* [[unsigned long]]

* [[byte]]

* [[int]]

* [[long]]

* [[unsigned long]]

April 16, 2007, at 09:23 PM
by

- Added lines 24-25:

When variables are made to exceed their maximum capacity they "roll over" back to their minimum capacitiy, note that this happens in both directions

April 16, 2007, at 06:35 PM
by

- Changed lines 24-28 from:

[@unsigned int x

x = 0;

x = x - 1; // x now contains 65535 - rolls over

x = 65535;

x = x + 1; // x now contains 0

x = 0;

x = x - 1; // x now contains 65535 - rolls over

x = 65535;

x = x + 1; // x now contains 0

to:

[@ unsigned int x

x = 0;

x = x - 1; // x now contains 65535 - rolls over in neg direction

x = 65535;

x = x + 1; // x now contains 0 - rolls over

x = 0;

x = x - 1; // x now contains 65535 - rolls over in neg direction

x = 65535;

x = x + 1; // x now contains 0 - rolls over

April 16, 2007, at 06:33 PM
by

- Changed lines 29-33 from:

to:

@]

April 16, 2007, at 06:32 PM
by

- Added lines 1-33:

!!unsigned int

!!!!Description

Unsigned ints (unsigned integers) are the same as ints in

that they store a 2 byte value. Instead of storing negative numbers however they only store positive values, yielding a useful range of 0 to 65,535 (2^16) - 1).

The difference lies in the way the highest bit, sometimes refered to as the "sign" bit is interpreted. In the Arduino int type, if the high bit is a "1", the number is interpreted as a negative number and the other 15 bits are interpreted with [[http://en.wikipedia.org/wiki/2%27s_complement | 2's complement math.]]

!!!!Example

[=int ledPin = 13;=]

!!!!Parameters

[=int var = val;=]

*var - your int variable name

*val - the value you assign to that variable

!!!!Coding Tip

[@unsigned int x

x = 0;

x = x - 1; // x now contains 65535 - rolls over

x = 65535;

x = x + 1; // x now contains 0

!!!!Description

Unsigned ints (unsigned integers) are the same as ints in

that they store a 2 byte value. Instead of storing negative numbers however they only store positive values, yielding a useful range of 0 to 65,535 (2^16) - 1).

The difference lies in the way the highest bit, sometimes refered to as the "sign" bit is interpreted. In the Arduino int type, if the high bit is a "1", the number is interpreted as a negative number and the other 15 bits are interpreted with [[http://en.wikipedia.org/wiki/2%27s_complement | 2's complement math.]]

!!!!Example

[=int ledPin = 13;=]

!!!!Parameters

[=int var = val;=]

*var - your int variable name

*val - the value you assign to that variable

!!!!Coding Tip

[@unsigned int x

x = 0;

x = x - 1; // x now contains 65535 - rolls over

x = 65535;

x = x + 1; // x now contains 0