Skip to content

Inconsistent error handling #1468

@t4c1

Description

@t4c1

Description

Error handling is not consistent between different mathematical functions. Most primitive functions only call std implementation and return NaN in case of invalid input. Some check for invalid input and throw exceptions.

Example

stan::math::log() directely calls std::log(). So any negative argument results in NaN return value.

stan::math::log1p() checks if its argument is less than -1 and throws std::domain_error if it is.

Expected Output

Consistent error handling.

Current Version:

v3.0.0

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