mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-22 04:58:35 +01:00
Add prod function and new sum function syntax to help.txt
This commit is contained in:
parent
23d78d40f2
commit
b9a6bfaab2
17
cli/help.txt
17
cli/help.txt
@ -51,19 +51,24 @@ Predefined functions
|
|||||||
min, max, hyp
|
min, max, hyp
|
||||||
log Eg. log(1000, 10) is the same as log10(1000)
|
log Eg. log(1000, 10) is the same as log10(1000)
|
||||||
root Eg. root(16, 3) is the same as 3√16
|
root Eg. root(16, 3) is the same as 3√16
|
||||||
sum Eg. sum(1, 4, 2n), example below
|
sum Eg. sum(n=1, 4, 2n), example below
|
||||||
|
|
||||||
Sum function
|
Sum function
|
||||||
The sum function lets you sum an expression with an incrementing variable.
|
The sum function lets you sum an expression with an incrementing variable.
|
||||||
It takes three arguments: start value, end value, and expression.
|
It takes three arguments: start value, end value, and expression.
|
||||||
If you press tab after typing out "sum", it will be replaced with a sigma symbol.
|
If you press tab after typing out "sum", it will be replaced with a sigma symbol.
|
||||||
The expression is what will be summed, and will be able to use the "n" variable,
|
The expression is what will be summed, and will be able to use the variable defined
|
||||||
which represents the current value between the start value and the end value.
|
in first argument (eg. n=1). The value of the variable increments by one.
|
||||||
The value of "n" increments.
|
Example: sum(n=1, 4, 2n) will be the same as 2*1 + 2*2 + 2*3 + 2*4 = 20
|
||||||
Example: sum(1, 4, 2n) will be the same as 2*1 + 2*2 + 2*3 + 2*4 = 20
|
This can for example be used to calculate e: Σ(n=0, 10000, 1/n!) = 2.7182818284590455
|
||||||
This can for example be used to calculate e: Σ(0, 10000, 1/n!) = 2.7182818284590455
|
|
||||||
More precision can be gotten by changing the "--precision" flag. Run `kalker --help` for more info.
|
More precision can be gotten by changing the "--precision" flag. Run `kalker --help` for more info.
|
||||||
|
|
||||||
|
The sum function can also be used to sum vectors, eg. sum(1, 2, 3) or sum(v) or sum[1, 2, 3].
|
||||||
|
|
||||||
|
Prod function
|
||||||
|
The prod function works the same way as the sum function but performs
|
||||||
|
multiplication instead of addition.
|
||||||
|
|
||||||
Constants
|
Constants
|
||||||
pi or π = 3.14159265
|
pi or π = 3.14159265
|
||||||
e = 2.71828182
|
e = 2.71828182
|
||||||
|
Loading…
Reference in New Issue
Block a user