diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-07-18 13:51:07 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-07-18 13:51:07 +0000 |
commit | 72abdbf55209579b5f4db97a95037ef43800d08a (patch) | |
tree | c2f67a08df3257515189ad6c0a5dfda3e04dd750 /atan2.c | |
parent | 17adbb9252c7cf03a822235405b4e0d1c4778740 (diff) | |
download | mpfr-72abdbf55209579b5f4db97a95037ef43800d08a.tar.gz |
atan2.c: quick-and-dirty fix for atan2(y,1)
tests/tatan.c: fix tests from Christopher [x and y were interchanged]
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4646 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'atan2.c')
-rw-r--r-- | atan2.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -153,6 +153,12 @@ mpfr_atan2 (mpfr_ptr dest, mpfr_srcptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) else goto set_zero; } + + /* When x=1, atan2(y,x) = atan(y). FIXME: more generally, if x is a power + of two, we could call directly atan(y/x) since y/x is exact. */ + if (mpfr_cmp_ui (x, 1) == 0) + return mpfr_atan (dest, y, rnd_mode); + MPFR_SAVE_EXPO_MARK (expo); /* Set up initial prec */ |