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

Successor/predecessor functions use isnan() and isinf() #209

Merged
merged 6 commits into from Sep 13, 2021

Conversation

cary-ilm
Copy link
Member

@cary-ilm cary-ilm commented Sep 7, 2021

isnan() and isinf() should more robust across different architectures than testing bit patterns.

Also, the unions should use uint32_t/uint64_t since they're guaranteed to be the appropriate size.

Signed-off-by: Cary Phillips cary@ilm.com

isnan() and isinf() should more robust across different architectures
than testing bit patterns.

Also, the unions should use uint32_t/uint64_t since they're guaranteed
to be the appropriate size.

Signed-off-by: Cary Phillips <cary@ilm.com>
@lgritz
Copy link
Contributor

lgritz commented Sep 7, 2021

Maybe we should deprecate predf and succf, and change the implementations in the mean time to just call C++11 nextafter(). The only problem is that nextafter can throw, but I don't know if that will bother anybody, if anyone even actually uses succf/predf.

@meshula
Copy link
Contributor

meshula commented Sep 7, 2021

I'm in favor of deprecation, with Cary's proposed re-implementation.

Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
@meshula
Copy link
Contributor

meshula commented Sep 11, 2021

I think all the i's have dotted and t's have crossed now?

@cary-ilm
Copy link
Member Author

I think so, although I filed #211 to follow up on Larry's suggestion of just dispensing with succf/predf altogether. But this fix should suffice for now.

@cary-ilm cary-ilm merged commit 07419c9 into AcademySoftwareFoundation:master Sep 13, 2021
cary-ilm added a commit to cary-ilm/Imath that referenced this pull request Jan 17, 2022
…areFoundation#209)

* Successor/predecessor functions use isnan() and isinf()

isnan() and isinf() should more robust across different architectures
than testing bit patterns.

Also, the unions should use uint32_t/uint64_t since they're guaranteed
to be the appropriate size.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add debugging info to testf()/testd()

Signed-off-by: Cary Phillips <cary@ilm.com>

* testf()/testd() checks isnan()

Signed-off-by: Cary Phillips <cary@ilm.com>

* Fix typo in testd()

Signed-off-by: Cary Phillips <cary@ilm.com>

* Cleanup & remove debugging info

Signed-off-by: Cary Phillips <cary@ilm.com>

* typo

Signed-off-by: Cary Phillips <cary@ilm.com>
cary-ilm added a commit that referenced this pull request Jan 20, 2022
* Successor/predecessor functions use isnan() and isinf()

isnan() and isinf() should more robust across different architectures
than testing bit patterns.

Also, the unions should use uint32_t/uint64_t since they're guaranteed
to be the appropriate size.

Signed-off-by: Cary Phillips <cary@ilm.com>

* Add debugging info to testf()/testd()

Signed-off-by: Cary Phillips <cary@ilm.com>

* testf()/testd() checks isnan()

Signed-off-by: Cary Phillips <cary@ilm.com>

* Fix typo in testd()

Signed-off-by: Cary Phillips <cary@ilm.com>

* Cleanup & remove debugging info

Signed-off-by: Cary Phillips <cary@ilm.com>

* typo

Signed-off-by: Cary Phillips <cary@ilm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants