int(pi)
int(pi)
[Inside a frame a formula is shown:] volume(r) = (4/int(pi))*pi*r^int(pi)
[Caption below the frame:] Programming Tip: The number "3" is cursed. Avoid it.

This comic purports to provide a tip to programmers, that the number " 3 " is cursed and shouldn't be used. There is no explanation given as to why the number 3 is cursed, and it could well have been chosen arbitrarily. The title text hints that the consequence for using the cursed number is non-functioning code, a pain for any programmer. The absurdity of the number 3 somehow being cursed is part of the humor.
To assist the programmer, the comic gives an example of how to avoid the use of the number 3, by using a slightly convoluted method of using int(pi) , which means the integer part of pi , without the fractional part . Pi, an irrational number , has a value starting 3.14159... , making int(pi) equal to 3. This is demonstrated in a formula to calculate the volume of a sphere , normally (4/3)*pi*(r^3), but converted for avoidance of the number 3 to (4/int(pi))*pi*(r^int(pi)).
For a number of reasons it is a good programming practice to use variables and constants where a value is used in multiple places, however this is not typically used in the case of natural numbers. There are unusual situations where this type of programming is a valid method, however typically for more specific circumstances, and not a certain number being seen as cursed.
In the title text, Randall takes the joke a step further, suggesting the usage of floor and ceiling functions : ceiling(pi) would be pi rounded up to the next integer, which is 4 ; and floor(pi) is pi rounded down to the next integer, which is 3. (Note that int(n) and floor(n) have the same value when n is greater than or equal to zero. For values less than zero, int(n) is equal to ceiling(n) .)
The joke here plays on the fact that basic rules of programming are confusing and novice programmers are often told to simply not do certain things without any explanation (see 292: goto ). This includes, in particular, a general proscription against " magic numbers " in the code. Replacing all significant magic numbers with named constants makes programs easier to read, understand and maintain. Randall takes this to an extreme by suggesting that certain numbers could be inherently problematic, but the general idea is perfectly believable.
Mmm... Floor pie. is a reference to The Simpsons.
See also Cargo cult programming .
[Inside a frame a formula is shown:] volume(r) = (4/int(pi))*pi*r^int(pi)
[Caption below the frame:] Programming Tip: The number "3" is cursed. Avoid it.
