xref: /aosp_15_r20/external/musl/src/math/i386/fmod.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1 #include <math.h>
2 
fmod(double x,double y)3 double fmod(double x, double y)
4 {
5 	unsigned short fpsr;
6 	// fprem does not introduce excess precision into x
7 	do __asm__ ("fprem; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y));
8 	while (fpsr & 0x400);
9 	return x;
10 }
11