You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
476 B
17 lines
476 B
#ifndef COSMOPOLITAN_LIBC_TINYMATH_EMODL_H_ |
|
#define COSMOPOLITAN_LIBC_TINYMATH_EMODL_H_ |
|
#include "libc/math.h" |
|
#if !(__ASSEMBLER__ + __LINKER__ + 0) |
|
|
|
/** |
|
* Returns Euclidean floating-point division remainder. |
|
* |
|
* @return (𝑥 mod 𝑦) ∈ [0.,𝑦) |
|
* @see fmodl() |
|
*/ |
|
static long double emodl(long double x, long double y) { |
|
return x - fabsl(y) * floorl(x / fabsl(y)); |
|
} |
|
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ |
|
#endif /* COSMOPOLITAN_LIBC_TINYMATH_EMODL_H_ */
|
|
|