X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fgen%2Fmplibm.c;h=ccb7c8126d164dc519014a3ed6be4cc9223f0c9c;hb=f3f0ff4782fc90bd0f3e48fd541ee431f76aaed1;hp=93225a99a41f398b32ce52c7b09eb9dc38f5c356;hpb=b5bbc6ebaeaf4381ea2436a3b410dcf4980c8efd;p=libc-test diff --git a/src/math/gen/mplibm.c b/src/math/gen/mplibm.c index 93225a9..ccb7c81 100644 --- a/src/math/gen/mplibm.c +++ b/src/math/gen/mplibm.c @@ -219,7 +219,7 @@ int mppow10(struct t *t) { return mpd1(t, pow10); } int mppow10f(struct t *t) { return mpf1(t, pow10f); } int mppow10l(struct t *t) { return mpl1(t, pow10l); } -#define mp_f_fi(n) \ +#define mp_fi_f(n) \ int mp##n(struct t *t) \ { \ t->dy = 0; \ @@ -229,17 +229,17 @@ int mp##n(struct t *t) \ return 0; \ } -mp_f_fi(ldexp) -mp_f_fi(ldexpf) -mp_f_fi(ldexpl) -mp_f_fi(scalbn) -mp_f_fi(scalbnf) -mp_f_fi(scalbnl) -mp_f_fi(scalbln) -mp_f_fi(scalblnf) -mp_f_fi(scalblnl) +mp_fi_f(ldexp) +mp_fi_f(ldexpf) +mp_fi_f(ldexpl) +mp_fi_f(scalbn) +mp_fi_f(scalbnf) +mp_fi_f(scalbnl) +mp_fi_f(scalbln) +mp_fi_f(scalblnf) +mp_fi_f(scalblnl) -#define mp_fi_f(n) \ +#define mp_f_fi(n) \ int mp##n(struct t *t) \ { \ int i; \ @@ -251,12 +251,12 @@ int mp##n(struct t *t) \ return 0; \ } -mp_fi_f(frexp) -mp_fi_f(frexpf) -mp_fi_f(frexpl) -mp_fi_f(lgamma_r) -mp_fi_f(lgammaf_r) -mp_fi_f(lgammal_r) +mp_f_fi(frexp) +mp_f_fi(frexpf) +mp_f_fi(frexpl) +mp_f_fi(lgamma_r) +mp_f_fi(lgammaf_r) +mp_f_fi(lgammal_r) int mplgamma(struct t *t) { @@ -313,3 +313,118 @@ mp_f_i(lround) mp_f_i(lroundf) mp_f_i(lroundl) +int mpmodf(struct t *t) +{ + double y2; + + t->dy = t->dy2 = 0; + setupfenv(t->r); + t->y = modf(t->x, &y2); + t->y2 = y2; + t->e = getexcept(); + return 0; +} + +int mpmodff(struct t *t) +{ + float y2; + + t->dy = t->dy2 = 0; + setupfenv(t->r); + t->y = modff(t->x, &y2); + t->y2 = y2; + t->e = getexcept(); + return 0; +} + +int mpmodfl(struct t *t) +{ + t->dy = t->dy2 = 0; + setupfenv(t->r); + t->y = modfl(t->x, &t->y2); + t->e = getexcept(); + return 0; +} + +int mpsincos(struct t *t) +{ + double y, y2; + + t->dy = t->dy2 = 0; + setupfenv(t->r); + sincos(t->x, &y, &y2); + t->y = y; + t->y2 = y2; + t->e = getexcept(); + return 0; +} + +int mpsincosf(struct t *t) +{ + float y, y2; + + t->dy = t->dy2 = 0; + setupfenv(t->r); + sincosf(t->x, &y, &y2); + t->y = y; + t->y2 = y2; + t->e = getexcept(); + return 0; +} + +int mpsincosl(struct t *t) +{ + t->dy = t->dy2 = 0; + setupfenv(t->r); + sincosl(t->x, &t->y, &t->y2); + t->e = getexcept(); + return 0; +} + +#define mp_ff_fi(n) \ +int mp##n(struct t *t) \ +{ \ + int i; \ + t->dy = 0; \ + setupfenv(t->r); \ + t->y = n(t->x, t->x2, &i); \ + t->e = getexcept(); \ + t->i = i; \ + return 0; \ +} + +mp_ff_fi(remquo) +mp_ff_fi(remquof) +mp_ff_fi(remquol) + +#define mp_fff_f(n) \ +int mp##n(struct t *t) \ +{ \ + t->dy = 0; \ + setupfenv(t->r); \ + t->y = n(t->x, t->x2, t->x3); \ + t->e = getexcept(); \ + return 0; \ +} + +mp_fff_f(fma) +mp_fff_f(fmaf) +mp_fff_f(fmal) + +#define mp_if_f(n) \ +int mp##n(struct t *t) \ +{ \ + t->dy = 0; \ + setupfenv(t->r); \ + t->y = n(t->i, t->x); \ + t->e = getexcept(); \ + return 0; \ +} + +mp_if_f(jn) +mp_if_f(jnf) +//mp_if_f(jnl) +mp_if_f(yn) +mp_if_f(ynf) +//mp_if_f(ynl) +