When C has the / operator to divide two numbers, what is the purpose of having the div() library function?
/
Is there any scenario where /
div_t is a structure, which contains a quotient member and a remainder member. For example :
div_t
typedef struct { int quot; int rem; } div_t;
Some simple implementations of the div function use / and % operators. You can also see this topic.
div
%