mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
parent
a988896048
commit
f317a47cd8
15 changed files with 315 additions and 253 deletions
|
@ -9,9 +9,12 @@
|
|||
* @return (𝑥 mod 𝑦) ∈ [0.,𝑦)
|
||||
* @see fmod()
|
||||
*/
|
||||
static inline double emod(double x, double y) {
|
||||
return x - fabs(y) * floor(x / fabs(y));
|
||||
}
|
||||
#define emod(x, y) \
|
||||
({ \
|
||||
double __x = x; \
|
||||
double __y = y; \
|
||||
__x - fabs(__y) * floor(__x / fabs(__y)); \
|
||||
})
|
||||
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_TINYMATH_EMOD_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue