Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math functions: Clarified value ranges and NaN #476

Merged
merged 13 commits into from
Dec 8, 2023
Merged
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased / Draft

### Fixed

- Trigonometric functions: Clarified that NaN is returned outside of their defined input range and defined output ranges where possible.

## [2.0.0-rc.1] - 2023-05-25

### Added
Expand Down
7 changes: 4 additions & 3 deletions arccos.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "arccos",
"summary": "Inverse cosine",
"description": "Computes the arc cosine of `x`. The arc cosine is the inverse function of the cosine so that *`arccos(cos(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.",
"description": "Computes the arc cosine of `x`. The arc cosine is the inverse function of the cosine so that *`arccos(cos(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values < -1 and > 1.",
"categories": [
"math > trigonometric"
],
Expand All @@ -23,7 +23,8 @@
"type": [
"number",
"null"
]
],
"minimum": 0
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
}
},
"examples": [
Expand All @@ -41,4 +42,4 @@
"title": "Inverse cosine explained by Wolfram MathWorld"
}
]
}
}
7 changes: 4 additions & 3 deletions arcosh.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "arcosh",
"summary": "Inverse hyperbolic cosine",
"description": "Computes the inverse hyperbolic cosine of `x`. It is the inverse function of the hyperbolic cosine so that *`arcosh(cosh(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.",
"description": "Computes the inverse hyperbolic cosine of `x`. It is the inverse function of the hyperbolic cosine so that *`arcosh(cosh(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values < 1.",
"categories": [
"math > trigonometric"
],
Expand All @@ -23,7 +23,8 @@
"type": [
"number",
"null"
]
],
"minimum": 0
}
},
"examples": [
Expand All @@ -41,4 +42,4 @@
"title": "Inverse hyperbolic cosine explained by Wolfram MathWorld"
}
]
}
}
4 changes: 2 additions & 2 deletions arcsin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "arcsin",
"summary": "Inverse sine",
"description": "Computes the arc sine of `x`. The arc sine is the inverse function of the sine so that *`arcsin(sin(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.",
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
"description": "Computes the arc sine of `x`. The arc sine is the inverse function of the sine so that *`arcsin(sin(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values < -1 and > 1.",
"categories": [
"math > trigonometric"
],
Expand Down Expand Up @@ -41,4 +41,4 @@
"title": "Inverse sine explained by Wolfram MathWorld"
}
]
}
}
8 changes: 5 additions & 3 deletions artanh.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "artanh",
"summary": "Inverse hyperbolic tangent",
"description": "Computes the inverse hyperbolic tangent of `x`. It is the inverse function of the hyperbolic tangent so that *`artanh(tanh(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.",
"description": "Computes the inverse hyperbolic tangent of `x`. It is the inverse function of the hyperbolic tangent so that *`artanh(tanh(x)) = x`*.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values <= -1 and >= 1.",
"categories": [
"math > trigonometric"
],
Expand All @@ -13,7 +13,9 @@
"type": [
"number",
"null"
]
],
"minimumExclusive": -1,
"maximumExclusive": 1
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
}
}
],
Expand Down Expand Up @@ -41,4 +43,4 @@
"title": "Inverse hyperbolic tangent explained by Wolfram MathWorld"
}
]
}
}
6 changes: 4 additions & 2 deletions cos.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"type": [
"number",
"null"
]
],
"minimum": -1,
"maximum": 1
}
},
"examples": [
Expand All @@ -41,4 +43,4 @@
"title": "Cosine explained by Wolfram MathWorld"
}
]
}
}
5 changes: 3 additions & 2 deletions cosh.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"type": [
"number",
"null"
]
],
"minimum": 1
}
},
"examples": [
Expand All @@ -41,4 +42,4 @@
"title": "Hyperbolic cosine explained by Wolfram MathWorld"
}
]
}
}
6 changes: 4 additions & 2 deletions sin.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"type": [
"number",
"null"
]
],
"minimum": -1,
"maximum": 1
}
},
"examples": [
Expand All @@ -41,4 +43,4 @@
"title": "Sine explained by Wolfram MathWorld"
}
]
}
}
4 changes: 2 additions & 2 deletions tan.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "tan",
"summary": "Tangent",
"description": "Computes the tangent of `x`. The tangent is defined to be the sine of x divided by the cosine of x.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated.",
"description": "Computes the tangent of `x`. The tangent is defined to be the sine of x divided by the cosine of x.\n\nWorks on radians only.\nThe no-data value `null` is passed through and therefore gets propagated. `NaN` is returned for values where the tangent function is not defined.",
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
"categories": [
"math > trigonometric"
],
Expand Down Expand Up @@ -41,4 +41,4 @@
"title": "Tangent explained by Wolfram MathWorld"
}
]
}
}
6 changes: 4 additions & 2 deletions tanh.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"type": [
"number",
"null"
]
],
"minimum": -1,
"maximum": 1
}
},
"examples": [
Expand All @@ -41,4 +43,4 @@
"title": "Hyperbolic tangent explained by Wolfram MathWorld"
}
]
}
}