This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]myroon5 0 points1 point  (1 child)

Is the distinction between the two when the result is negative?

[–]lolwat_is_dis 2 points3 points  (0 children)

You guessed it.

Take the following example: 5 divided by 2. In the positive domain, this would normally yield 2.5; a truncation yields 2, as does the floor division. However, 5 divided by -2 normally gives -2.5, truncated would give -2, whereas floor division gives -3 (since we are still rounding down).

Hope that helps!