# Enum spinoso_math::Error

source · [−]```
pub enum Error {
Domain(DomainError),
NotImplemented(NotImplementedError),
}
```

## Expand description

Sum type of all errors possibly returned from `Math`

functions.

Math functions in `spinoso-math`

return errors in the following conditions:

- The parameters evaluate to a result that is out of range.
- The function is not implemented due to missing compile-time flags.

## Variants

`Domain(DomainError)`

Error that indicates a math function returned a value that was out of range.

This error can be used to differentiate between `NaN`

inputs
and what would be `NaN`

outputs.

See `DomainError`

.

`NotImplemented(NotImplementedError)`

Error that indicates a `Math`

module function is not implemented.

See `NotImplementedError`

.

## Implementations

Retrieve the exception message associated with this error.

##### Examples

```
let err = Error::from(DomainError::new());
assert_eq!(err.message(), "Math::DomainError");
let err = Error::from(NotImplementedError::with_message(
"Artichoke was not built with Math::erf support"
));
assert_eq!(err.message(), "Artichoke was not built with Math::erf support");
```

## Trait Implementations

Performs the conversion.

Performs the conversion.

This method returns an ordering between `self`

and `other`

values if one exists. Read more

This method tests less than (for `self`

and `other`

) and is used by the `<`

operator. Read more

This method tests less than or equal to (for `self`

and `other`

) and is used by the `<=`

operator. Read more

This method tests greater than (for `self`

and `other`

) and is used by the `>`

operator. Read more

## Auto Trait Implementations

### impl RefUnwindSafe for Error

### impl UnwindSafe for Error

## Blanket Implementations

Mutably borrows from an owned value. Read more