I know there is a term for a number that is the power of 2, such as 8, 32, 128, 4096 -- but it slipped my mind.
-
2Just for the record - is there a reason you skipped every other power of two in your example?!!– FattieJul 11, 2011 at 8:34
-
1Actually 4096 fits the pattern, because it's a power of 2.– AlenannoJul 11, 2011 at 8:58
-
2@Alenanno: I think the pattern Joe meant was the standard sequence of powers of two are 2,4,8,16,32,64,128,256,512 .. and Jen used alternate powers in the post 8,32,128 and then jumped to 4096.– JoseKJul 11, 2011 at 9:40
-
9I'd call them round numbers, but that may be a programmers affliction. ;)– MSaltersJul 11, 2011 at 10:16
-
2@Alenanno Just for what it's worth. Read my comment again. It says "In your example", the example being: "8, 32, 128, 4096". OK?– FattieJul 11, 2011 at 15:44
2 Answers
A "power of two" seems like a good name.
Although 'exponent' has been suggested, it is not correct
The relationship is quite simple, though:
3 is the exponent which generates the power of two 8 (23 = 8)
12 is the exponent which generates the power of two 4096 (212 = 4096)
-
1Indeed. Any mathematical documentation I can find refers to them as powers of two. Jul 11, 2011 at 9:00
-
7"It's more precise than saying an exponent." - No, "exponent" would simply be wrong here, not just less precise. Why did you even mention it? It just muddies the waters. I could understand it if Jen had suggested it, and you were making a correction - but you're just correcting yourself here.– MT_HeadJul 12, 2011 at 10:00
-
@MT_Head, I agree. What I typed yesterday was just fastest gun in the west syndrome. I could edit my answer, but it seems a little late now.– paviumJul 12, 2011 at 11:33
-
@pavium - Feel free to edit your answer! Remember, the whole reputation-points thing is (supposed to be) secondary to giving correct answers, not just for the OP but for future Googlers. In this case, a straight edit would make your answer identical with @Digital Powers', but perhaps an explanatory note? Future Googlers might not read the comments.– MT_HeadJul 12, 2011 at 16:39
In programming, especially graphics programming (textures), powers of two are sometimes referred to as POT, and non-powers of two as NPOT.
But obviously the word "pot" has strong connotations, and so this term can be used only in such a context unambiguously. Anywhere else, "power of two" is a much better choice.
-
Fascinating, @nikai, I have never heard that one. Can you see any examples of that online, just out of curiosity? Cheers– FattieJul 12, 2011 at 8:00
-
2Sure, here are two OpenGL specifications using it for texture dimensions: opengl.org/registry/specs/ARB/texture_non_power_of_two.txt opengl.org/registry/specs/NV/texture_rectangle.txt Here it is used in papers in context of ordering policy: or.journal.informs.org/cgi/content/abstract/58/2/492 ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=4737780 Jul 12, 2011 at 9:20
-
FANTASTIC REFERENCE, Nikai! Awesome. @Jen, @Nikai has a great term, even though little arcane. I mentioned 3D graphics in my answer -- there's the term!! How awesome. Great stuff.– FattieJul 12, 2011 at 10:35