Skip to content

Conversation

@davebayer
Copy link
Contributor

This PR simplifies the numeric_limits implementation for floating point types by reusing our already existing __fp_meow machinery.

@davebayer davebayer requested a review from a team as a code owner November 7, 2025 16:27
@davebayer davebayer requested a review from griwes November 7, 2025 16:27
@github-project-automation github-project-automation bot moved this to Todo in CCCL Nov 7, 2025
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Nov 7, 2025
@davebayer davebayer force-pushed the extend_fp_constants branch from cf6ddbb to 534847e Compare November 7, 2025 16:29
@davebayer davebayer force-pushed the extend_fp_constants branch from 534847e to 624f99e Compare November 7, 2025 17:03
@github-actions

This comment has been minimized.

Copy link
Contributor

@fbusato fbusato left a 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;
Copy link
Contributor

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;
Copy link
Contributor

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);
Copy link
Contributor

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

@github-project-automation github-project-automation bot moved this from In Review to In Progress in CCCL Nov 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2025

😬 CI Workflow Results

🟥 Finished in 3h 01m: Pass: 44%/90 | Total: 3d 06h | Max: 3h 00m | Hits: 32%/57911

See results here.

@davebayer davebayer self-assigned this Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants