-
Notifications
You must be signed in to change notification settings - Fork 294
Generate numeric_limits for floating points from __fp_meow machinery
#6550
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
base: main
Are you sure you want to change the base?
Conversation
cf6ddbb to
534847e
Compare
534847e to
624f99e
Compare
This comment has been minimized.
This comment has been minimized.
fbusato
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PR removes several lines from numeric_limits.h and delete numeric_limits_ext.h, which is great! On the other hand, many times we use numeric_limits without the need of extended types. Would not be better to separate the implementations?
| } | ||
|
|
||
| static constexpr bool is_iec559 = true; | ||
| static constexpr int radix = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we not add at least a static_assert for FLT_RADIX?
| } | ||
|
|
||
| static constexpr int min_exponent = __fp_exp_min_v<__fmt> + 1; | ||
| static constexpr int min_exponent10 = (30103ll * __fp_exp_min_v<__fmt>) / 100000ll; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please comment magic numbers
| using namespace test_integer_literals; | ||
|
|
||
| // 1. Test formats | ||
| test_fp_epsilon<cuda::std::__fp_format::__binary16>(0x1400u); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would not be better to compute the epsilon instead of fixed value? e.g. (1 + "last_bit") - 1
😬 CI Workflow Results🟥 Finished in 3h 01m: Pass: 44%/90 | Total: 3d 06h | Max: 3h 00m | Hits: 32%/57911See results here. |
This PR simplifies the
numeric_limitsimplementation for floating point types by reusing our already existing__fp_meowmachinery.