Skip to content

Arithmetic advices for expm1 and hypot + others #258

Open
@genmeblog

Description

@genmeblog

I've just found some advices in arithmetic which shouldn't be there.

(dec (exp x)) and (expm1 x) are not equivalent. expm1 is more precise near 0.0 but it shouldn't be treated as drop in replacement in every case. The same for hypot (which catches overflows and underflow).

Also (long (+ x 0.5)) fails on overflow while (Math/round) not. Catching overflow can be beneficial in some cases so I would be careful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions