PaddiM8 / kalker

Scientific calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
https://kalker.xyz
MIT License
1.64k stars 74 forks source link

Support compositional forms #36

Open abrudz opened 3 years ago

abrudz commented 3 years ago

It'd be nice if this worked:

>> f(x)=2x
>> g(x)=x^2
>> (f∘g)(4)
32
>> (f+g)(f)
24

etc.

See https://www.mathsisfun.com/sets/functions-composition.html and https://www.mathsisfun.com/sets/functions-operations.html

PaddiM8 commented 3 years ago

Neat, didn't know that was a thing in maths. Hopefully it isn't too awkward to parse. I guess "if function names are used inside a group (parenthesis), expect an argument after this, and parse the group as some sort of function call". This may happen.