title: Check if float is an integer: is_integer() vs. modulo 1
body: <p>I've seen a number of questions asking how to check if a float is an integer. Majority of answers seem to recommend using <code>is_integer()</code>:</p>
  
  <pre><code>(1.0).is_integer()
  (1.55).is_integer()
  </code></pre>
  
  <p>I have also occasionally seen <code>math.floor()</code> being used:</p>
  
  <pre><code>import math
  1.0 == math.floor(1.0)
  1.55 == math.floor(1.55)
  </code></pre>
  
  <p>I'm wondering why <code>% 1</code> is rarely used or recommended?</p>
  
  <pre><code>1.0 % 1 == 0
  1.55 % 1 == 0
  </code></pre>
  
  <p>Is there a problem with using modulo for this purpose? Are there edge cases that this doesn't catch? Performance issues for really large numbers?</p>
  
  <p>If <code>% 1</code> is a fine alternative, then I'm also wondering why <code>is_integer()</code> was introduced to the standard library? </p>
  
  <p>It seems that <code>%</code> is much more flexible. For example, its common to use <code>% 2</code> to check if a number is odd/even, or <code>% n</code> to check if something is a multiple of <code>n</code>. Given this flexibility, why introduce a new method (<code>is_integer</code>) that does the same thing, or use <code>math.floor</code>, both of which require knowing/remembering that they exist and knowing how to use them? I know that <code>math.floor</code> has uses beyond just integer checking but still...</p>