title: converting python to java float vs double
body: <p>I need to convert the <a href="https://github.com/asdfhamiltonian/planets/blob/master/luna.py" rel="nofollow noreferrer">following python code</a> to Java and remember from the past that handling decimal values must be done carefully otherwise the results will not be accurate.
  My question is, can I use <strong>doubles</strong> for all non-interger values given doubles are more accurate that floats?</p>
  
  <p>Here is my start of the conversion:</p>
  
  <p>Python code</p>
  
  <pre><code>def degrees(rads):
      return (rads/pi)*180
  
  
  def radians(degrees):
  return (degrees/180 * pi)
  
  
  def fnday(y, m, d, h):
  a = 367 * y - 7 * (y + (m + 9) // 12) // 4 + 275 * m // 9
  a += d - 730530 + h / 24
  return a
  </code></pre>
  
  <p>Java conversion</p>
  
  <pre><code>public double degress(double rads)
  {
      return (rads/PI)*180;
  }
  
  public double radians(double degrees)
  {
      return (degrees/180 * PI);
  }
  
  public double fnday(int y, int m, int d, int h)
  {
      double a = 367 * y - 7 * (y + (m + 9) / 12) / 4 + 275 * m / 9;
      a += d - 730530 + h / 24;
      return a;
  }
  </code></pre>
  
  <p>I know it may be a simple answer but I need to know the postion of the moon and sun for the app and do not want to rely on an api for this data.  I simple want to put in the latitude and longitdue and get the sun and moon rise and set times.</p>