Skip to content

run f16 float tests#518

Open
folkertdev wants to merge 1 commit intorust-lang:masterfrom
folkertdev:test-float-f16
Open

run f16 float tests#518
folkertdev wants to merge 1 commit intorust-lang:masterfrom
folkertdev:test-float-f16

Conversation

@folkertdev
Copy link
Copy Markdown
Contributor

the float-cmp and num-traits libraries don't (yet) support f16, and likely won't do so before the type is stabilized.

Luckily it turns out that we only really need one function from them for checking whether two floats are "close enough". Miri already has this logic, which I've adapted here.

https://github.com/rust-lang/miri/blob/871d3d06c549cb554dec9a3a7c37cdd723254d06/tests/pass/float.rs#L40-L51

With that we can actually drop the dependency on float-cmp, which is neat too.

the `float-cmp` and `num-traits` libraries don't (yet) support f16. Turns out we didn't really need much from them, just the ulps check. I've adapted the ulps check from miri instead
@folkertdev folkertdev changed the title Test float f16 run f16 float tests Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant