I once wrote a program for my graphic calculator based on the exact same logic described by sbeitzel above. However, because calculator BASIC doesn't support data types, it wasn't long before I tried entering fractional numbers of sides. The logic works just the same: the central angle is split into, say, 3.5 and then the program draws a 3.5-sided regular polygon! Something of a mathematical curiosity, so I investigated.

Say you enter 2.5 as the number of sides: write 2.5 as a fraction it's lowest terms, ie 5/2. Therefore, you will discover, the actually has five lines but it "goes round" twice. This is hard to describe without a picture, but fortunately, this case is exactly what it is known as a pentagram! Draw one for yourself, and you'll see what I mean. It has five lines, but it appears to complete two whole rotations. A shape with 2.25 sides is 9/4, so it has 9 lines and completes 4 rotations.

However, because we rely on writing the the number of sides as the ratio of two integers to discover the number of lines, what about numbers that cannot be written in this form: irrational numbers? Well, when you set the program to draw, for example, a pi-sided figure, it simply goes round and round forever, drawing an infinite number of lines, going round an infinite number of times, until the individual lines are lost in the realms of resolution and it looks like a slice through a torus. You could see this as the program trying to estimate the value of that irrational number with ever-more accurate fractions.

You can also enter negative values, but this doesn't yield anything quite so interesting; with my version of the program, it simply draws the lines in reverse order, finishing with a polygon just the same as with the absolute value of the number.

Just an interesting bit of geometry-related experimentation, showing what can be done with expanding a very simple concept. I'm still trying to get my head round the logical next extension: figures with complex numbers for their side count. Answers below if you have any insight on this.