MCPcopy Create free account
hub / github.com/coreutils/coreutils / simple_round_nearest

Function simple_round_nearest

src/numfmt.c:413–417  ·  view source on GitHub ↗

EXTREMELY limited 'round' - without 'libm'. Assumes values that fit in intmax_t. */

Source from the content-addressed store, hash-verified

411/* EXTREMELY limited 'round' - without 'libm'.
412 Assumes values that fit in intmax_t. */
413static inline intmax_t
414simple_round_nearest (long double val)
415{
416 return val < 0 ? val - 0.5 : val + 0.5;
417}
418
419ATTRIBUTE_CONST
420static inline long double

Callers 1

simple_roundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected