Arduino Digit upper limit

I am just getting started with the Arduino and have Duemilanove 328. I have an idea for an project down the line but for it I need to know what, if any, the upper limit for integer variable might be. Like how calculators can only display 8 digits and will error out if you ask it to add 1 to 99,999,999.
So my question is, Has anyone come across such an upper limit or seen it documented anywhere?


“int”* -32768 to +32767
“long” -231 to +231-1
“long long” - 263 to +263-1

*An Arduino “int”, that is.

or seen it documented anywhere

Oddly enough, it’s in the reference:
I’m surprised your search didn’t find it.

Arduino Integer Types...

Standard Integer Types...

I suspect there is documentation for the floating-point types but I can't find it. Basically, a 4-byte IEEE floating-point is supported. The data-type is float or double.

Thank you AWOL and Coding Badly.
This will help a lot later.
I guess I just used the wrong search strings.

Basically, a 4-byte IEEE floating-point is supported

Not for the faint of heart :slight_smile:

After some digging around in the links provided and further Google attempts, It would seem UnsignedLong Would be the best for my purpose. As it gives me the largest number range with no interest in low than zero. It will get me up to 4,294,967,295 before stopping. :o

It would seem UnsignedLong Would be the best for my purpose

You never told us what that was, but if you had, you could have had an answer earlier.

I would like to generate a graphic of prime numbers as binary. where 1 is a white dot and 0 is a black(off) dot.
I have done this on graph paper to kill time and always get comments like "That looks cool/nice/pretty" from people that look over my shoulder. For me it is self imposed challenge for both programming and electrical design.

I think, depending on the method of display chosen, that it would essentially be 'nerd Art'. It would look interesting to just about anyone that saw it but only the real nerds would get it.

I would like to generate a graphic of prime numbers as binary. where 1 is a white dot and 0 is a black(off) dot.

Don't forget, that you're not on a PC any more but that you work on a micro-controller with limited resources. On the Duemilanove or the Uno you have 2kB of RAM available, which gives you a maximum of 16300 Pixel (give or take a few). For that, no need to worry about exceeding 20000 and integers will do.

If you want to run the sieve of Eratosthenes for more, you need a device which keeps track of the pixel on its own without the need of a screen buffer. Some screens offers this, you for extra coolness paint it with a paint gun attached a motorized pan and tilt head controlled by your Arduino.



Since you want to generate some graphics "processing" might be a better tool for you.


It all matters on the method of display I use.
You are right, that If I were to use something like a monitor or TV I would have to be aware of the limits of either the memory or the screen. Though I think I would the horizontal edge of the screen before worrying about using up my pixels in a single integer.
Looking around, I have seen some projects that place 160x120 pixels. With 941 being the 160th prime number and it being only 10 digits long (1110101101), I would start scrolling. 160x120 screen is only 19200, while over the perceived maximum would still allow for an impressive scrolling pattern loop.
But that Is why I give myself such a challenge, because the possibilities are so varied. I could just as easily use a method similar to the accounting calculators to print the developing pattern off a roll of paper. That is why I asked about upper limits, Those limits should be the only thing to bind me in the challenge.

@Fletcher - While the graphic is part of the point, it isn’t the whole of it. Basically I am dealing with two bits of color and don’t really need a platform that is designed to deal with graphics. Black and white for this case is simply a matter of on or off. It could just as easily be red and green LEDs.

-Sorry about the double post, I lost connection while typing my last post and didn’t realize another post had slide in before it.