Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log1p(-1) does not raise exception #205

Open
kargl opened this issue Mar 13, 2020 · 2 comments
Open

log1p(-1) does not raise exception #205

kargl opened this issue Mar 13, 2020 · 2 comments

Comments

@kargl
Copy link
Contributor

kargl commented Mar 13, 2020

No description provided.

@kargl
Copy link
Contributor Author

kargl commented Mar 13, 2020

Here's the test code.
Sorry about poor formatting, but github interface does not seem to
hone fixed width fonts with whitespace.

#include <fenv.h>
#include <math.h>
#include <stdio.h>
int main(void) {
   fexcept_t flags;
   float x,y;
   x = -1.f;
   feclearexcept(FE_ALL_EXCEPT);
   y = log1p(x);
   fegetexceptflag(&flags, FE_ALL_EXCEPT);
  if (!(flags & FE_DIVBYZERO)) printf("Whoops! Where FE_DIVBYZERO?\n");
  printf("%e %e\n", x, y);
  return (0);
}

This was fixed in FreeBSD by

r251024 | das | 2013-05-27 01:50:10 -0700 (Mon, 27 May 2013) | 9 lines
cc -o z a.c openlibm-master/libopenlibm.a
% ./z
Whoops! Where FE_DIVBYZERO?
-1.000000e+00 -inf

@kargl kargl closed this as completed Sep 11, 2021
@oscardssmith
Copy link
Member

This hasn't yet been fixed

@oscardssmith oscardssmith reopened this May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants