import math


def decimal_to_base60(deci,precision=1e-8):
  """Converts decimal number into sexagesimal number parts. 

 ``deci`` is the decimal number to be converted. ``precision`` is how
 close the multiple of 60 and 3600, for example minutes and seconds,
 are to 60.0 before they are rounded to the higher quantity, for
 example hours and minutes.
 """
  sign = "+" # simple putting sign back at end gives errors for small
             # deg. This is because -00 is 00 and hence ``format``,
             # that constructs the delimited string will not add '-'
             # sign. So, carry it as a character.
  if deci < 0:
    deci = abs(deci)
    sign = "-" 

  frac1, num = math.modf(deci)
  num = int(num) # hours/degrees is integer valued but type is float
  frac2, frac1 = math.modf(frac1*60.0)
  frac1 = int(frac1) # minutes is integer valued but type is float
  frac2 *= 60.0 # number of seconds between 0 and 60 

  # Keep seconds and minutes in [0 - 60.0000)
  if abs(frac2 - 60.0) < precision:
    frac2 = 0.0
    frac1 += 1
  if abs(frac1 - 60.0) < precision:
    frac1 = 0.0
    num += 1 

  return (sign,num,frac1,frac2)