Live data from Hacker News

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

kalk.strct.net

41–50 of 90 posts

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

#41
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!

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

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

#42

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.

Can you elaborate? I think I know what you mean, but when I clicked the link it already seemed to be a "more advanced bc" to me. What are you missing, big numbers (that's what came to my mind)?

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

#43

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.

what features from bc do you need? Have you seen calc (the calc package in debian/ubuntu)?

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

#44

For fun, try to run this: `2 + 2 * 10%` in all calculators you have access to: on you phone, on your desktop, in kalk. As they say, "the answer will surprise you" :)

Is there an explanation for the answer in kalk? Seems buggy

It seems like an expression like "1 * 10%" in kalk is computed as if it means "1% * 10%" => "0.01 * 0.1" => "0.001"

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

#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 need to perform operations step by step, when, say, estimating something. So either 10 \n + 20 \n * 3 ..., or just referencing last output like some special variable. I though I could do it more verbosely by just x = 10; x = x + 20 ..., but that gives "Variable references itself."

3) Not sure about this one, since this is not something natural at all, and I don't know what to propose to make it natural (at least without proposing map/filter/reduce and some sort of multi-line inputs). Neither is it a real problem, but it's just something I probably use a calculator most often: simply adding up a dozen of numbers, copied from somewhere as a column. So currently I must first open vim, convert it to and expression bc will handle ( 15 + 21 + 32 ...), and then paste in to bc. With kalk it would be similar. Would be great if one could skip that step since this (I assume) would be a common use-case. But, yeah, I don't have an actual suggestion on how to naturally address that.

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

#46

Earlier quoted context omitted.

Performing the calculation with Soulver did not surprise me (being what I calculated in my head ahead of time): 2 + 2 × 10% = 2.2 At the risk of admitting my ignorance, yet more interested in learning something new: should this answer (2.2) surprise me?

Wolfram Alpha and iOS also give 2.2 On MacOS the answer is 2.4 In kalk it's 2.002 On Windows it's 0.4 in simple calc, and 2 in programmer calc (and there's no % in engineering calc)

What about the win32 calculator shipped with w7 and w10 ltsc?

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

#49

Earlier quoted context omitted.

Performing the calculation with Soulver did not surprise me (being what I calculated in my head ahead of time): 2 + 2 × 10% = 2.2 At the risk of admitting my ignorance, yet more interested in learning something new: should this answer (2.2) surprise me?

Wolfram Alpha and iOS also give 2.2 On MacOS the answer is 2.4 In kalk it's 2.002 On Windows it's 0.4 in simple calc, and 2 in programmer calc (and there's no % in engineering calc)

Android gives me 2.2

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

#50

For fun, try to run this: `2 + 2 * 10%` in all calculators you have access to: on you phone, on your desktop, in kalk. As they say, "the answer will surprise you" :)

The calculator that comes with MIUI 12 (Xiaomi phone) writes everything as you type, like you'd expect.

But, the moment you type `%`, it instead replaces `10` with `0.1`. So in the end the screen shows: 2+2x0.1 = 2.2

I guess not as surprising as you expected :-]

Post reply on HN