diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2012-03-13 10:34:05 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2012-03-13 10:34:05 +0000 |
commit | b0c9eb764a6737c1c55a9002bfdc5b6c535a5fce (patch) | |
tree | f992dd100854aa65206286f00c0ad4d61169eb18 /regress/usr.bin | |
parent | 95f0827f7ca17a3d1e7fd754a0cdf37453c24b96 (diff) |
better bounds
Diffstat (limited to 'regress/usr.bin')
-rw-r--r-- | regress/usr.bin/bc/t19.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/regress/usr.bin/bc/t19.c b/regress/usr.bin/bc/t19.c index 28b0cf8710f..1e241e97373 100644 --- a/regress/usr.bin/bc/t19.c +++ b/regress/usr.bin/bc/t19.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t19.c,v 1.1 2012/03/13 10:12:52 otto Exp $ */ +/* $OpenBSD: t19.c,v 1.2 2012/03/13 10:34:04 otto Exp $ */ /* * Copyright (c) 2012 Otto Moerbeek <otto@drijf.net> @@ -60,8 +60,13 @@ main() prec = pow(10, -scale[si]); if (prec < LDBL_EPSILON) prec = LDBL_EPSILON; + prec *= 2; /* XXX cheating ? */ - if (diff > 20*prec) { + if (funcs[fi].f == logl) + prec *= 4; + else if (funcs[fi].f == expl) + prec *= 8; + if (diff > prec) { printf("%s %d %Le %Le %Le %Le %Le\n", funcs[fi].name, scale[si], v, d1, d2, diff, prec); |