![]() That’s beyond the scope of this tutorial, though. Some round towards zero, others round down. Different languages do different things when doing integer division with negative numbers. It looks like \ the operator comes from the BASIC world. Ruby will also do it automatically with integers and it can be forced with Numeric#div. Python 2.x will also do it automatically with integer types, but it can be forced to do it with a / / symbol, which is required in Python 3.x. Javascript requires taking Math.floor() of regular division. Java and C will do it automatically as long as you’re dividing integer types. Different languages represent integer division in different ways. In (positive) integer division, we divide two numbers and discard the decimal part.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |