title: CGFloat: round, floor, abs, and 32/64 bit precision
body: <p>TLDR: How do I call standard floating point code in a way that compiles both 32 and 64 bit CGFloats without warnings?</p>
  
  <hr>
  
  <p>CGFloat is defined as either double or float, depending on the compiler settings and platform. I'm trying to write code that works well in both situations, without generating a lot of warnings.</p>
  
  <p>When I use functions like floor, abs, ceil, and other simple floating point operations, I get warnings about values being truncated. For example:</p>
  
  <blockquote>
    <p>warning: implicit conversion shortens 64-bit value into a 32-bit value</p>
  </blockquote>
  
  <p>I'm not concerned about correctness or loss of precision in of calculations, as I realize that I could just use the double precision versions of all functions all of the time (floor instead of floorf, etc); however, I would have to tolerate these errors.</p>
  
  <p>Is there a way to write code cleanly that supports both 32 bit and 64 bit floats without having to either use a lot of #ifdef __ LP64 __ 's, or write wrapper functions for all of the standard floating point functions? </p>