Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Can floating-point data in C language be used as remainder?
Can floating-point data in C language be used as remainder?
Floating-point data in C language cannot be a remainder.

A floating-point data, after being converted into plastic data, can be divided and remainders to obtain its one bit, ten bits and one hundred bits. Convert to int type before taking the remaining%.

For example, floating-point data 52 1.63 is converted into plastic data, which is 52 1. Rounding 100 can get the unit number 1, rounding 10 can get the decimal number 2, and dividing by 100 can get the decimal number 5.

Extended data:

Arithmetic of remainder operation;

1 、( a + b) % p = (a % p + b % p) % p

2 、( a - b) % p = (a % p - b % p) % p

3 、( a * b) % p = (a % p * b % p) % p

4、a ^ b % p = ((a % p)^b) % p

5 、((a+b) % p + c) % p = (a + (b+c) % p) % p (5)

6 、((a*b) % p * c)% p = (a * (b*c) % p) % p (6)

7 、( a + b) % p = (b+a) % p

8 、( a * b) % p = (b * a) % p

9 、( a+b) % p = ( a % p + b % p ) % p

10 、((a+b)% p * c)% p =((a * c)% p+(b * c)% p)% p?

Baidu encyclopedia-floating point data

Baidu encyclopedia-modular operation