X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmath%2Futil.h;h=9218a7538e1a7c39658668c663f3a0d5e019c475;hb=667aded8ff906ada3cde9bc1483768133300b4d3;hp=1fc6939f5ee05b431ad65d3cfd498ec4c7f9bf45;hpb=cb9f87af9a1f917facd1140603b24f1087729751;p=libc-test diff --git a/src/math/util.h b/src/math/util.h index 1fc6939..9218a75 100644 --- a/src/math/util.h +++ b/src/math/util.h @@ -84,6 +84,12 @@ struct l_i {POS int r; long double x; long long i; int e; }; struct d_dd {POS int r; double x; double y; float dy; double y2; float dy2; int e; }; struct f_ff {POS int r; float x; float y; float dy; float y2; float dy2; int e; }; struct l_ll {POS int r; long double x; long double y; float dy; long double y2; float dy2; int e; }; +struct ff_fi {POS int r; float x; float x2; float y; float dy; long long i; int e; }; +struct dd_di {POS int r; double x; double x2; double y; float dy; long long i; int e; }; +struct ll_li {POS int r; long double x; long double x2; long double y; float dy; long long i; int e; }; +struct fff_f {POS int r; float x; float x2; float x3; float y; float dy; int e; }; +struct ddd_d {POS int r; double x; double x2; double x3; double y; float dy; int e; }; +struct lll_l {POS int r; long double x; long double x2; long double x3; long double y; float dy; int e; }; #undef POS char *estr(int); @@ -95,11 +101,9 @@ float ulperrl(long double got, long double want, float dwant); static int checkexcept(int got, int want, int r) { - // TODO: we dont checkunderflow and inexact for now if (r == RN) - return (got|INEXACT|UNDERFLOW) == (want|INEXACT|UNDERFLOW); -// return got == want || got == (want|INEXACT); - return 1; + return got == want || got == (want|INEXACT); + return (got|INEXACT|UNDERFLOW) == (want|INEXACT|UNDERFLOW); } static int checkulp(float d, int r) @@ -110,3 +114,10 @@ static int checkulp(float d, int r) return 1; } +static int checkcr(long double y, long double ywant, int r) +{ + if (isnan(ywant)) + return isnan(y); + return y == ywant && signbit(y) == signbit(ywant); +} +