Skip to content

Precision::multiply overflow #17928

@Tpt

Description

@Tpt

Describe the bug

In 32bits platforms, Precision::<usize>::multiply can quickly overflow, leading to a panic on debug builds.

To Reproduce

Precision::Exact(usize::MAX).multiply(&Precision::Exact(2))

Expected behavior

The operation should saturate and Exact estimation should become Inexact

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions