From 711654eeabc77df467d42224b6951d312bf6f725 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Wed, 10 Feb 2021 12:44:19 -0800 Subject: [PATCH] Fix incorrect results in `hypotl` near underflow Fixes #224. --- src/e_hypotl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/e_hypotl.c b/src/e_hypotl.c index 047484d6..26327745 100644 --- a/src/e_hypotl.c +++ b/src/e_hypotl.c @@ -82,7 +82,7 @@ hypotl(long double x, long double y) man_t manh, manl; GET_LDBL_MAN(manh,manl,b); if((manh|manl)==0) return a; - t1=0; + t1=1; SET_HIGH_WORD(t1,ESW(MAX_EXP-2)); /* t1=2^(MAX_EXP-2) */ b *= t1; a *= t1;