Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can the remainder/modulus operator be used with floating point operands?

0
Posted

Can the remainder/modulus operator be used with floating point operands?

0

The % operator, called the modulus or remainder operator, returns the remainder of two numbers. In C and C++, the remainder operator accepts only integral operands, but in the Java programming language, it also accepts floating-point operands. Remeber that the evaluation of a floating-point remainder operator % never throws a run-time exception, even if the right-hand operand is zero. Overflow, underflow, or loss of precision cannot occur.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.