title: How do I use modulus for float/double?
body: <p>I'm creating an RPN calculator for a school project and having trouble with the modulus operator. Since we're using the double data type, modulus won't work on floating-point numbers. For example, 0.5 % 0.3 should return 0.2, but I'm getting a division by zero exception.</p>
  <p>The instruction says to use <code>fmod()</code>. I've looked everywhere for <code>fmod()</code>, including javadoc, but I can't find it. I'm starting to think it's a method I'm going to have to create?</p>
  <p>Edit: Hmmm, strange. I just plugged in those numbers again and it seems to be working fine… but just in case. Do I need to watch out for using the mod operator in Java when using floating types? I know something like this can't be done in C++ (I think).</p>