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

Replace UINT_MAX with explicit cast #938

Merged
merged 4 commits into from Feb 26, 2021

Conversation

cary-ilm
Copy link
Member

Avoid a compiler warning about implicit cast from integer to float, and use numeric_limits<> instead of explicit macro symbols.

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

The fixes compiler warnings about implicit conversion from integer to
float.

Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
return half::posInf();

if (f < -HALF_MAX)
if (f < -std::numeric_limits<half>::max())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have lowest() on half? Maybe that's the thing to use. I was thinking it may not be the case that -max() == lowest() for half at some point in the future if we start using processor specific intrinsics for the implementation. The standard calls this case out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we do ... currently defined as

    static half lowest() { return -HALF_MAX; }

in halfLimits.h

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Signed-off-by: Cary Phillips <cary@ilm.com>
@cary-ilm cary-ilm merged commit f7589a6 into AcademySoftwareFoundation:master Feb 26, 2021
@cary-ilm cary-ilm deleted the convert-fix branch May 18, 2021 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants