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

Add a Kani function that checks if the range of a float is valid for conversion to int #3742

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zhassan-aws
Copy link
Contributor

This introduces a new generic Kani function, kani::float::float_to_int_in_range, that can be used for checking if a floating-point value satisfies the range requirement of the to_int_unchecked methods, e.g https://doc.rust-lang.org/std/primitive.f32.html#method.to_int_unchecked and https://doc.rust-lang.org/std/primitive.f64.html#method.to_int_unchecked.

Resolves #3711

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@zhassan-aws zhassan-aws requested a review from a team as a code owner November 27, 2024 00:13
@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-BenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for in_range
1 participant