Skip to content

Const all the floating point arithmetic #751

Description

@davidgraymi

What problem does this solve or what need does it fill?

Floating point arithmetic can now be used in constant functions! This is a valuable API improvement, as it allows users to define their own derived constants using our handy math operations.

Describe the solution you'd like

We should constify our APIs, one library at a time. This should be kept to relatively simple functions and methods: only things that we can commit to being const indefinitely.

Describe alternatives you've considered

Use a quick sweep of cargo clippy --fix --allow-dirty -- -W clippy::missing_const_for_fn to set all functions that allow it to const.

Additional context

I come from bevy and want to support bevyengine/bevy#16124.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions