This is because javascript has no concept of an integer -- only numbers (which are stored as IEEE floats). Floats have a finite precision, if you try to make a number more precise than the float can represent, it will be "truncated" -- Which is exactly what is happening with your big numbers. Consider the python "equivalent":
>>> int(float(3289568273632879456235)) % 6
0L
Here's a few more interesting tidbits to hopefully make the point a little more clear:
>>> int(float(3289568273632879456235)) # Notice, the different result due to loss of precision.
3289568273632879706112L
>>> int(float(3289568273632879456235)) == int(float(3289568273632879456236)) # different numbers, same result due to "truncation"
True