Live data from Hacker News

Show HN: Kalk, A calculator with math syntax, complex numbers

kalk.strct.net

51–60 of 90 posts

Re: Show HN: Kalk, A calculator with math syntax, complex numbers

#51
post #45

This looks extremely useful, even though currently makes quite a few mistakes, as noted by others. A few features that could be nice: 1) It handles 1 000 000 * 3 just fine, but returns 3000000. So it would be nice if it would format output as 3 000 000 as well for readability. At least as an optional setting (even though I have no idea why someone wouldn't want that). 2) Some way of referencing last result. Often you…

These are some great suggestions! I should absolutely make it add spaces, can't believe I didn't think of that.

Also, it actually does have a way to reference the last result, I forgot to document it. It's a variable called "ans"!

The last thing, yeah, that would be neat. I'll think about it...

Re: Show HN: Kalk, A calculator with math syntax, complex numbers

#52
post #45

This looks extremely useful, even though currently makes quite a few mistakes, as noted by others. A few features that could be nice: 1) It handles 1 000 000 * 3 just fine, but returns 3000000. So it would be nice if it would format output as 3 000 000 as well for readability. At least as an optional setting (even though I have no idea why someone wouldn't want that). 2) Some way of referencing last result. Often you…

> At least as an optional setting (even though I have no idea why someone wouldn't want that).

Copy/pasting? At least each three zeroes could alternate in color, to make it easier to paste the numbers elsewhere.

Re: Show HN: Kalk, A calculator with math syntax, complex numbers

#53

This is really nice and all, but what I (and probably many others) would love is an alternative to `bc`. It's so useful but also so limited.

If you're looking for something more advanced while still at the command prompt, check out "calc":

http://isthe.com/chongo/tech/comp/calc/

On Fedora:

sudo dnf install calc ; alias bc=calc

Re: Show HN: Kalk, A calculator with math syntax, complex numbers

#54
post #20
post #18

This seems off: >> f(x) = x^2 >> f''(4) 0.9995297887

Oh yeah, derivatives of higher order being less accurate is a known problem. I forgot to specify that, thanks!

Note that if f(x) = x^2 then the second derivative f''(x) = 2, so it looks like you're off by a factor of 2 (as well as the accuracy issue).

Re: Show HN: Kalk, A calculator with math syntax, complex numbers

#55
post #20

Earlier quoted context omitted.

Oh yeah, derivatives of higher order being less accurate is a known problem. I forgot to specify that, thanks!

look into Dual numbers. That way there is no accuracy loss. More generally look into AD (automatic differentiation). thanks me later, cheers

Maybe the derivation could be done by the complex step trick, if programing an AD system is too hard

Re: Show HN: Kalk, A calculator with math syntax, complex numbers

#57

Kudos to the author, it seems a very nice calculator program. Any chance in the future that Kalk will support quaternion numbers[1]? [1] https://en.wikipedia.org/wiki/Quaternion

Thank you.

Oh my... aren't those really complicated? Haha

Re: Show HN: Kalk, A calculator with math syntax, complex numbers

#58
post #57

Kudos to the author, it seems a very nice calculator program. Any chance in the future that Kalk will support quaternion numbers[1]? [1] https://en.wikipedia.org/wiki/Quaternion

Thank you. Oh my... aren't those really complicated? Haha

You can operate on them using the same rules as complex numbers with a slight twist.

Re: Show HN: Kalk, A calculator with math syntax, complex numbers

#60

Kudos to the author, it seems a very nice calculator program. Any chance in the future that Kalk will support quaternion numbers[1]? [1] https://en.wikipedia.org/wiki/Quaternion

Can you give an example of a quaternion computation that would be useful in a calculator? I would imagine that quaternions and GA are best suited to have a graphical output, ala https://enkimute.github.io/ganja.js/examples/coffeeshop.html ?
Post reply on HN