Kanipaan

1.9.0

A command line calculator

Introducing Expanders

25th of April 2026

I am excited to announce a major new feature in Kanipaan: Expanders.

Expanders allow you to define your own functions and mathematical substitutions directly in the CLI. This makes complex calculations much easier to manage and reuse.

How to use Expanders

To define an expander, use the => operator. The left side specifies the function name and its arguments, and the right side specifies the expression to expand into.

Simple Functions

You can define a simple squaring function like this:

kani > f(x) => x ^ 2
Expander added

Now you can use it just like any other operator:

kani > f(5)
25.0

Multiple Arguments

Expanders support multiple arguments as well. For example, to calculate the hypotenuse of a right-angled triangle:

kani > hypot(a, b) => (a ^ 2 + b ^ 2) ^ 0.5
Expander added

kani > hypot(3, 4)
5.0

Why “Expanders”?

We call them expanders because they literally expand your input into a larger expression before calculation. This means they are incredibly flexible and can be used for more than just simple functions—they are your own personal mathematical shortcuts.

Stay happy calculating with Kanipaan!

– Karthikeyan (For Kanipaan.)