Skip to content

List of operations that produce NaN? #29

@kameko

Description

@kameko

The documentation for dashu_float says that operations that produce NaN will panic. I'd like to be able to check for such conditions before performing those operations, so I can catch them and return Err instead. However, I don't know all possible operations that can panic, and the source code doesn't make it obvious. I'm checking for the obvious right now in my code, checking for any operations that work with infinity, etc.. But I think the documentation should specifically list every operation that can panic.

Additionally, it would be nice if the standard library actually had some kind of would_panic or results_in_nan function to explicitly check that for you, or stuff like try_div or try_mul, etc., but I'm just thinking out loud.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions