Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed Dec 5, 2023
1 parent 8f41d54 commit ae1f5a3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Welcome to the Rudi documentation :smile:
* [`*`](functions/math-mult.md) – returns the product of all of its arguments
* [`+`](functions/math-add.md) – returns the sum of all of its arguments
* [`-`](functions/math-sub.md) – returns arg1 - arg2 - .. - argN
* [`/`](functions/math-div.md) – returns arg1 / arg2 / .. / argN
* [`/`](functions/math-div.md) – returns arg1 / arg2 / .. / argN (always a floating point division, regardless of arguments)

## Strings Functions

Expand Down
2 changes: 1 addition & 1 deletion docs/functions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ applied to all functions (so technically `eq?!` is valid, though weird looking).
* [`*`](../functions/math-mult.md) – returns the product of all of its arguments
* [`+`](../functions/math-add.md) – returns the sum of all of its arguments
* [`-`](../functions/math-sub.md) – returns arg1 - arg2 - .. - argN
* [`/`](../functions/math-div.md) – returns arg1 / arg2 / .. / argN
* [`/`](../functions/math-div.md) – returns arg1 / arg2 / .. / argN (always a floating point division, regardless of arguments)

## Strings Functions

Expand Down
5 changes: 4 additions & 1 deletion docs/functions/math-div.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
`/` returns the quotient of dividing all arguments. Arguments must evaluate to
numeric values. `div` is an alias for this function.

To prevent ambiguity, this function always performs floating point divisions,
regardless if all its arguments are integer numbers.

## Examples

* `(/ 9 3 2)` -> `1.5` ((9 / 3) / 2)
* `(/ 9 3 2)` -> `1.5` ((9.0 / 3.0) / 2.0)
* `(/ 1 0)` -> invalid: division by zero

## Forms
Expand Down
2 changes: 1 addition & 1 deletion pkg/eval/functions/args_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func contextConsumer(ctx types.Context, args []cachedExpression) (asserted []any
return []any{ctx}, args, nil
}

// toVariadicConsumer wraps a singular consumer to consume all remaining args. In constrast to
// toVariadicConsumer wraps a singular consumer to consume all remaining args. In contrast to
// Go, variadic arguments must have at least 1 item (i.e. calling func(foo string, a ...int) with
// ("abc") only is invalid).
func toVariadicConsumer(singleConsumer argsConsumer) argsConsumer {
Expand Down

0 comments on commit ae1f5a3

Please sign in to comment.