Skip to content

Conversation

@red-hara
Copy link

This commit adds the libm optional feature (not enabled by default) to turn the corresponding feature in the num-traits dependency crate. The commit updates some default SI units and changes Float exporting rules.

The libm crate enables math support for #![no_std] crates, including trigonometric functions. Those are implemented for Angle and Ratio quantities, and now are supported and usable in a wider area of cases.

red-hara added 2 commits July 15, 2025 14:02
This commit adds the `libm` optional feature (not enabled by default) to
turn the corresponding feature in the `num-traits` dependency crate. The
commit updates some default SI units and changes `Float` exporting
rules.

The `libm` crate enables math support for `#![no_std]` crates,
including trigonometric functions. Those are implemented for `Angle` and
`Ratio` quantities, and now are supported and usable in a wider area of
cases.
The `libm` can be used in more cases enabled with the `std` feature by
default. Various non-trigonometric functions (power, square root, etc.)
can be used with `libm` support in `#![no_std]` environment.
@dzmitry-lahoda
Copy link

see also #309

@red-hara
Copy link
Author

Thanks for pointing that out!

I see... I'm not the first one to stumble over lack of float-related operations in uom.

What would be the best strategy at the current moment? Should I invest some time into updating my changes in favor of suggested modifications in #309 or attempt to update the #309 to the current state of uom? (The possibility to rely on my own fork for now is an option too, but less preferable.)

That way or another, thanks for considering my pull request.

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.

2 participants