Skip to content

Conversation

@t-a-k
Copy link
Contributor

@t-a-k t-a-k commented Dec 27, 2020

Previously POSIX::signbit() had a fallback implementation for the case Perl_signbit is not defined, but this code is apparently broken because it returns wrongly non-zero (true) value for signbit(+0.0).
Currently Perl_signbit is always defined (either as a macro or as a function), so it seems to be better to use it unconditionally.

Additionally, unused macro c99_signbit is deleted, which is also apparently broken because there is no signbitl() in C99.

Previously POSIX::signbit() had a fallback implementation for the case
Perl_signbit is not defined, but this is apparently broken
because it returns wrongly non-zero (true) value for signbit(+0.0).
Currently Perl_signbit is always defined (either as a macro or as
a function), so it can be used unconditionally.

Additionally, unused macro c99_signbit is deleted, which is also
apparently broken because there is no signbitl() in C99.
@jkeenan jkeenan changed the title Use Perl_signbit uncoditionally for POSIX::signbit() Use Perl_signbit unconditionally for POSIX::signbit() Dec 27, 2020
@jkeenan
Copy link
Contributor

jkeenan commented Dec 27, 2020

Previously POSIX::signbit() had a fallback implementation for the case Perl_signbit is not defined, but this code is apparently broken because it returns wrongly non-zero (true) value for signbit(+0.0).
Currently Perl_signbit is always defined (either as a macro or as a function), so it seems to be better to use it unconditionally.

Additionally, unused macro c99_signbit is deleted, which is also apparently broken because there is no signbitl() in C99.

Can you specify more precisely what you mean by previously and currently?

@jkeenan
Copy link
Contributor

jkeenan commented Dec 27, 2020

Previously POSIX::signbit() had a fallback implementation for the case Perl_signbit is not defined, but this code is apparently broken because it returns wrongly non-zero (true) value for signbit(+0.0).
Currently Perl_signbit is always defined (either as a macro or as a function), so it seems to be better to use it unconditionally.

Additionally, unused macro c99_signbit is deleted, which is also apparently broken because there is no signbitl() in C99.

@khwilliamson, @doughera88 You have worked on what appears to be a relevant section of numeric.c. Could you take a look at this p.r.?

Thank you very much.
Jim Keenan

@t-a-k
Copy link
Contributor Author

t-a-k commented Dec 27, 2020

Previously POSIX::signbit() had a fallback implementation for the case Perl_signbit is not defined, but this code is apparently broken because it returns wrongly non-zero (true) value for signbit(+0.0).
Currently Perl_signbit is always defined (either as a macro or as a function), so it seems to be better to use it unconditionally.
Additionally, unused macro c99_signbit is deleted, which is also apparently broken because there is no signbitl() in C99.

Can you specify more precisely what you mean by previously and currently?

Sorry for my lack of explanation. These are based on this commit (c934219, which is based on blead's dba7cf2); I mean "before c934219" by previously and "as of c934219" by currently.

@khwilliamson khwilliamson merged commit ae2473a into Perl:blead Dec 27, 2020
@khwilliamson
Copy link
Contributor

I looked at the code, and this commit looks to be the right thing to do

@t-a-k t-a-k deleted the fix-posix-signbit branch December 28, 2020 14:34
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

Successfully merging this pull request may close these issues.

3 participants