Theremainderfunctionand % operator. the following code cannot be compiled (gcc) # compile destdio. h # includefenv. hintmain () {doublex10; printf (x % 2% lfn, x % 2.0); return0;} operator % can only operate on Integer Data (guess, % is implemented based on the data bit shift ). this
The remainder function and % operator. the following code cannot be compiled (gcc) # include stdio. h # include fenv. hint main () {double x = 10; printf (x % 2 = % lf \ n, x % 2.0); return 0;} operator % can only operate in integer data, (assume that % is implemented based on data bit shift ). this
The remainder function and % operator.
The following code cannot be compiled (gcc)
# Include
# Include
Int main () {double x = 10; printf ("x % 2 = % lf \ n", x % 2.0); return 0 ;}
Operator % can only operate on Integer Data (guess, % is implemented based on data bit shift ).
Here, the floating point number calls the remainder. Fmod (doube x, double y) in it.