I found the Math law Two _ Mathematics

Source: Internet
Author: User

MoD () is the remainder function

MoD (15, 7) = 1

MoD (15,-7) =-6

MoD (-15, 7) = 6

MoD (-15,-7) =-1

15 = 7 * 2 + 1

15 = (-7) * (-3) + (-6)

-15 = 7 * (-3) + 6

-15 = (-7) *2 + (-1)

The divisor, divisor, quotient, and remainder are respectively recorded as M, N, p, q (M, n, p, n >= 0)

Then there are:

m = n * p1 + q1

m = (-N) * (-P2) + (-Q2)

-M = n * (-P3) + Q3

-M = (-N) * P4 + (-Q4)

The positive and negative signs of divisor, divisor, quotient and remainder are as follows:

Dividend

Divisor

Business

Remainder

+

+

+

+

+

-

-

-

-

+

-

+

-

-

+

-

Rule 1: The symbol of the divisor = remainder.

Rule 2: The relationship between the two symbols of divisor and divisor:

Case 1: The same number, the symbol of the business is positive (symbol or);

Case 2: The sign of the quotient is negative (the symbol is the same or) when the number is different.

Rule 3: Business to be as small as possible (positive numbers closer to 0 smaller, negative numbers farther away from 0 smaller). The remainder is used to fill the absolute value of the remainder < divisor.

Rule 4: Quotient p1 = P4;-p2 =-p3;

Rule 5: Remainder Q1 + (-q4) = 0; (-q2) + q3 = 0;

Q1 + q3 = N; (-q2) + (-q4) =-n;q1 + | (-Q2) | = N;q3 + | (-Q4) | = N

(where | | is the absolute value symbol)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.