remquo Results Not Making Sense

后端 未结 2 1469
不知归路
不知归路 2020-12-22 05:23

I read here that remquo should return:

If successful, returns the floating-point remainder of the division x/y as defined in

2条回答
  •  执念已碎
    2020-12-22 05:50

    The behavior is correct; as stated in std::remainder, the quotient is rounded to nearest integer, then the remainder could be negative.

    If you are working with integer, I suggest you the C function div()

提交回复
热议问题