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

Function powerld

src/numfmt.c:332–345  ·  view source on GitHub ↗

Similar to 'powl(3)' but without requiring 'libm'. */

Source from the content-addressed store, hash-verified

330
331/* Similar to 'powl(3)' but without requiring 'libm'. */
332static long double
333powerld (long double base, int x)
334{
335 long double result = base;
336 if (x == 0)
337 return 1; /* note for test coverage: this is never
338 reached, as 'powerld' won't be called if
339 there's no suffix, hence, no "power". */
340
341 /* TODO: check for overflow, inf? */
342 while (--x)
343 result *= base;
344 return result;
345}
346
347/* Similar to 'fabs(3)' but without requiring 'libm'. */
348static inline long double

Callers 3

simple_strtod_floatFunction · 0.85
simple_strtod_humanFunction · 0.85
double_to_humanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected