Search found 1 match

by trwrt
Wed Oct 09, 2013 4:52 am UTC
Forum: Individual XKCD Comic Threads
Topic: 1275: "int(pi)"
Replies: 95
Views: 29484

Re: 1275: "int(pi)"

This code doesn't work correctly. Because of the parens around (4/int(pi)) the expression will be evaluated as an integer, yielding 1 instead of 1.3333... Only after the division does the result get promoted to float for the rest of the operations. If it read 4/int(pi)*pi*r^int(pi) then it would wor...

Go to advanced search