public static double projectTimeWithin24Hours(double time){
  double secondsInOneDay=60 * 60 * 24;
  if (time == Double.NEGATIVE_INFINITY || time == Double.POSITIVE_INFINITY) {
    DebugLib.stopSystemAndReportInconsistency("time is not allowed to be minus or plus infinity");
  }
  while (time < 0) {
    time+=secondsInOneDay;
  }
  if (time < secondsInOneDay) {
    return time;
  }
 else {
    return ((time / secondsInOneDay) - (Math.floor(time / secondsInOneDay))) * secondsInOneDay;
  }
}

public static double projectTimeWithin24Hours ( double time ) { double secondsInOneDay = 60 * 60 * 24 ; if ( time == Double . NEGATIVE_INFINITY || time == Double . POSITIVE_INFINITY ) { DebugLib . stopSystemAndReportInconsistency ( "time is not allowed to be minus or plus infinity" ) ; } while ( time < 0 ) { time += secondsInOneDay ; } if ( time < secondsInOneDay ) { return time ; } else { return ( ( time / secondsInOneDay ) - ( Math . floor ( time / secondsInOneDay ) ) ) * secondsInOneDay ; } }
if time is > 60 * 60 * 24 [ seconds ] , it will be projected into next day , e . g . time = 60 * 60 * 24 + 1 = 1 even if time is negative , it is turned into a positive time by adding number of seconds of day into it consecutively
