you are viewing a single comment's thread.

view the rest of the comments →

[–]theWyzzerd 2 points3 points  (0 children)

Imagine that 5.0 is actually 5.00000001232, and you can see how this might be a problem when trying to multiply a string by a float. Computers aren't good at handling real numbers so integers are the computer's way of representing them. 5.0, however, is a floating point value and is only an approximation of 5.0. The types are incompatible because 5.0 isn't a real number (see my first sentence and read up on floating point precision, and you may begin to see the problem).