Lines Matching full:round
95 /* Round to nearest with ties going to nearest even integer
100 double rounded = round(x); in _PyTime_RoundHalfEven()
102 /* halfway case: round to even */ in _PyTime_RoundHalfEven()
103 rounded = 2.0*round(x/2.0); in _PyTime_RoundHalfEven()
109 _PyTime_Round(double x, _PyTime_round_t round) in _PyTime_Round() argument
115 if (round == _PyTime_ROUND_HALF_EVEN) { in _PyTime_Round()
118 else if (round == _PyTime_ROUND_CEILING) { in _PyTime_Round()
121 else if (round == _PyTime_ROUND_FLOOR) { in _PyTime_Round()
125 assert(round == _PyTime_ROUND_UP); in _PyTime_Round()
133 long idenominator, _PyTime_round_t round) in _PyTime_DoubleToDenominator() argument
143 floatpart = _PyTime_Round(floatpart, round); in _PyTime_DoubleToDenominator()
166 long denominator, _PyTime_round_t round) in _PyTime_ObjectToDenominator() argument
178 denominator, round); in _PyTime_ObjectToDenominator()
191 _PyTime_ObjectToTime_t(PyObject *obj, time_t *sec, _PyTime_round_t round) in _PyTime_ObjectToTime_t() argument
204 d = _PyTime_Round(d, round); in _PyTime_ObjectToTime_t()
225 _PyTime_round_t round) in _PyTime_ObjectToTimespec() argument
227 return _PyTime_ObjectToDenominator(obj, sec, nsec, SEC_TO_NS, round); in _PyTime_ObjectToTimespec()
232 _PyTime_round_t round) in _PyTime_ObjectToTimeval() argument
234 return _PyTime_ObjectToDenominator(obj, sec, usec, SEC_TO_US, round); in _PyTime_ObjectToTimeval()
381 _PyTime_FromDouble(_PyTime_t *t, double value, _PyTime_round_t round, in _PyTime_FromDouble() argument
390 d = _PyTime_Round(d, round); in _PyTime_FromDouble()
401 _PyTime_FromObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round, in _PyTime_FromObject() argument
411 return _PyTime_FromDouble(t, d, round, unit_to_ns); in _PyTime_FromObject()
435 _PyTime_FromSecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round) in _PyTime_FromSecondsObject() argument
437 return _PyTime_FromObject(t, obj, round, SEC_TO_NS); in _PyTime_FromSecondsObject()
441 _PyTime_FromMillisecondsObject(_PyTime_t *t, PyObject *obj, _PyTime_round_t round) in _PyTime_FromMillisecondsObject() argument
443 return _PyTime_FromObject(t, obj, round, MS_TO_NS); in _PyTime_FromMillisecondsObject()
475 const _PyTime_round_t round) in _PyTime_Divide() argument
478 if (round == _PyTime_ROUND_HALF_EVEN) { in _PyTime_Divide()
493 else if (round == _PyTime_ROUND_CEILING) { in _PyTime_Divide()
501 else if (round == _PyTime_ROUND_FLOOR){ in _PyTime_Divide()
510 assert(round == _PyTime_ROUND_UP); in _PyTime_Divide()
521 _PyTime_AsMilliseconds(_PyTime_t t, _PyTime_round_t round) in _PyTime_AsMilliseconds() argument
523 return _PyTime_Divide(t, NS_TO_MS, round); in _PyTime_AsMilliseconds()
527 _PyTime_AsMicroseconds(_PyTime_t t, _PyTime_round_t round) in _PyTime_AsMicroseconds() argument
529 return _PyTime_Divide(t, NS_TO_US, round); in _PyTime_AsMicroseconds()
534 _PyTime_round_t round) in _PyTime_AsTimeval_impl() argument
543 usec = (int)_PyTime_Divide(ns, US_TO_NS, round); in _PyTime_AsTimeval_impl()
572 _PyTime_round_t round, int raise) in _PyTime_AsTimevalStruct_impl() argument
578 res = _PyTime_AsTimeval_impl(t, &secs, &us, round); in _PyTime_AsTimevalStruct_impl()
598 _PyTime_AsTimeval(_PyTime_t t, struct timeval *tv, _PyTime_round_t round) in _PyTime_AsTimeval() argument
600 return _PyTime_AsTimevalStruct_impl(t, tv, round, 1); in _PyTime_AsTimeval()
604 _PyTime_AsTimeval_noraise(_PyTime_t t, struct timeval *tv, _PyTime_round_t round) in _PyTime_AsTimeval_noraise() argument
606 return _PyTime_AsTimevalStruct_impl(t, tv, round, 0); in _PyTime_AsTimeval_noraise()
611 _PyTime_round_t round) in _PyTime_AsTimevalTime_t() argument
616 res = _PyTime_AsTimeval_impl(t, &secs, us, round); in _PyTime_AsTimevalTime_t()