Home > Back-end >  The symbol of modulus calculation
The symbol of modulus calculation

Time:06-09

True, use commonly used in hand and compiler environment, such as GCC, vc and operator is depends on the result of the modulus, but kony sweat and representative of c program design language, in the second edition clear said, modular arithmetic symbols depends on implementation,

Check weiji encyclopedia said Chinese c99 cancelled ambiguity, there is no clear sign, and I'll find the c99 to the source document, which a great god can dispel doubts?

CodePudding user response:

Listen to the compiler.

CodePudding user response:

C99 already defined very complete,

CodePudding user response:

Defined here is complete? Symbols according to the modulus to order? Did not say ah,

CodePudding user response:

Listen to the compiler? But I don't have all the compiler!!

CodePudding user response:

reference qq_44422004 reply: 3/f
defined here is complete? Symbols according to the modulus to order? No such say,

Does not directly say so, but since 105) to 0 rounding, believe that you can deduce the "symbols according to be module to" this conclusion,

CodePudding user response:

Not explicitly said/operator discarding the decimal part as a result of the quotient algebra, algebraic operation, elementary school students understand, - 5/2=2.5, 5/- 2=2.5, - 5/- 2=2.5

CodePudding user response:

A==a/b * b + a % b
So the result is a % b - a/b * b;

2-5%
==- 5 - (5/2 - * 2)
==4-5 -
==1

2-5% -
==- 5 - (-/- 5 2 * 2)
==4-5 -
==1

5% - 2
==5 - (5 -/- 2 * 2)
==5-4
==1

CodePudding user response:

The
reference 7 floor lin5161678 response:
a==a/b * b + a % b
So the result is a % b - a/b * b;

2-5%
==- 5 - (5/2 - * 2)
==4-5 -
==1

2-5% -
==- 5 - (-/- 5 2 * 2)
==4-5 -
==1

5% - 2
==5 - (5 -/- 2 * 2)
==5-4
==1

Got it! Thank you very much! Positive solution! Ten words,

CodePudding user response:

The
reference 7 floor lin5161678 response:
a==a/b * b + a % b
So the result is a % b - a/b * b;

2-5%
==- 5 - (5/2 - * 2)
==4-5 -
==1

2-5% -
==- 5 - (-/- 5 2 * 2)
==4-5 -
==1

5% - 2
==5 - (5 -/- 2 * 2)
==5-4
==1

To learn! collection

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related