What is the result of C translation for % operator and fmod() function in machine language? What is it's implementation?
For example: Will 61199 % 256 be solved the same way as 61199 % 171?
What is the result of C translation for % operator and fmod() function in machine language? What is it's implementation?
For example: Will 61199 % 256 be solved the same way as 61199 % 171?
Copyright © 2021 Jogjafile Inc.
If the platform supports integer division, like all modern non-embedded processors, it is a single instruction. The division instruction gives the quotient and the remainder.
Consider this C program (https://godbolt.org/z/vxj8fKdjG):
It compiles to:
In this output
idivis the division instruction.