Skip to content

Commit

Permalink
Merge pull request #169 from Open-EO/mod
Browse files Browse the repository at this point in the history
#168: Clarifications for mod (modulo)
  • Loading branch information
m-mohr authored Jul 6, 2020
2 parents 4bfc660 + 1418b8a commit d4b91dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `filter_bbox`, `load_collection`, `resample_spatial`: Fixed invalid EPSG code examples.
- `aggregate_temporal`: Fixed outdated message for exception `TooManyDimensions`.
- `clip`: Fixed examples.
- `mean`: Clarify behaviour for arrays with `null`-values only.
- `mod`: Clarified behaviour. [#168](https://github.com/Open-EO/openeo-processes/issues/168)
- `resample_*`: Clarified behaviour.
- `first`, `last`, `max`, `mean`, `median`, `min`, `sd`, `variance`: Clarify behavior for arrays with `null`-values only.

Expand Down
13 changes: 9 additions & 4 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "mod",
"summary": "Modulo",
"description": "Remainder after division of `x` by `y`.\n\nThe result of a modulo operation has the sign of the divisor. The handling regarding the sign of the result [differs between programming languages](https://en.wikipedia.org/wiki/Modulo_operation) and needs careful consideration while implementing this process.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`.",
"description": "Remainder after division of `x` by `y` for both integers and floating-point numbers.\n\nThe result of a modulo operation has the sign of the divisor. The handling regarding the sign of the result [differs between programming languages](https://en.wikipedia.org/wiki/Modulo_operation#In_programming_languages) and needs careful consideration to avoid unexpected results.\n\nThe no-data value `null` is passed through and therefore gets propagated if any of the arguments is `null`. A modulo by zero results in ±infinity if the processing environment supports it. Otherwise a `DivisionByZero` error must the thrown.",
"categories": [
"math"
],
Expand Down Expand Up @@ -36,6 +36,11 @@
]
}
},
"exceptions": {
"DivisionByZero": {
"message": "Division by zero is not supported."
}
},
"examples": [
{
"arguments": {
Expand All @@ -53,10 +58,10 @@
},
{
"arguments": {
"x": 27,
"y": -5
"x": 3.14,
"y": -2
},
"returns": -3
"returns": -0.86
},
{
"arguments": {
Expand Down

0 comments on commit d4b91dd

Please sign in to comment.