Accelerated C++ on quotients

104 views Asked by At

I am reading the book "Accelerated C++". In the details of chapter 2, a description of division between two numbers and extracting their quotient is provided:

x / y

Quotient of x and y . If both operands are integers, the implementation chooses whether to round toward zero or - 8

I don't understand this one. What does "round toward [...] - 8" mean? What implementations use that and why?

Well I tried searching for that but didn't find anything.

1

There are 1 answers

0
Sinan Ünür On BEST ANSWER

The book probably means round towards negative infinity, i.e. -∞:

Directed roundings

  • Round toward 0 – directed rounding towards zero (also known as truncation).
  • Round toward +∞ – directed rounding towards positive infinity (also known as rounding up or ceiling).
  • Round toward −∞ – directed rounding towards negative infinity (also known as rounding down or floor).

Either there was a typesetting error, or you are not seeing it correctly.