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

Function simple_round_ceiling

src/numfmt.c:378–385  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

376/* EXTREMELY limited 'ceil' - without 'libm'.
377 Assumes values that fit in intmax_t. */
378static inline intmax_t
379simple_round_ceiling (long double val)
380{
381 intmax_t intval = val;
382 if (intval < val)
383 intval++;
384 return intval;
385}
386
387/* EXTREMELY limited 'floor' - without 'libm'.
388 Assumes values that fit in intmax_t. */

Callers 3

simple_round_floorFunction · 0.85
simple_round_from_zeroFunction · 0.85
simple_roundFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected