[Solved] invalid operands of types ‘double’ and ‘double’ to binary ‘operator%’ [duplicate]


What’s the expected output of 12.3 % 4.2 ?
If you have an answer for that, you also have to roll your own implementation, built in operator% works for integer types only.

If you are fine with that, but your arguments happen to be floating point values, round/floow/ceil/cast them. e.g:

static_cast<uint64_t>(double_value);

solved invalid operands of types ‘double’ and ‘double’ to binary ‘operator%’ [duplicate]