title: "Nearly divisible"
body: <p>I want to check if a floating point value is "nearly" a multiple of 32.  E.g. 64.1 is "nearly" divisible by 32, and so is 63.9.</p>
  
  <p>Right now I'm doing this:</p>
  
  <pre><code>#define NEARLY_DIVISIBLE 0.1f
  float offset = fmodf( val, 32.0f ) ;
  if( offset &lt; NEARLY_DIVISIBLE )
  {
      // its near from above
  }
  // if it was 63.9, then the remainder would be large, so add some then and check again
  else if( fmodf( val + 2*NEARLY_DIVISIBLE, 32.0f ) &lt; NEARLY_DIVISIBLE )
  {
      // its near from below
  }
  </code></pre>
  
  <p>Got a better way to do this?</p>