Live data from Hacker News

SpeedCrunch

speedcrunch.org

51–60 of 138 posts

Re: SpeedCrunch

#51
post #45

Somehow, it seems speedcrunch has a problem in dealing with big numbers. For example, I can do: (3(7^204+7^202+7^200)+7(3^204+3^200)-210) mod 10 in the calculator that comes with linux and get the right result (which is 7), but speedcrunch overflows and outputs 0. I've set the result format to fixed decimal and precision to 50 digits, but that doesn't seem to make a difference. Edit: Just tried it with insect, which…

If you mean bc as the 'calculator that comes with linux', thats somewhat to be expected. Speedcrunch deals with a maximum integer size of 256 bits (~1.15e77), while bc is an arbitrary precision calculator.

Sorry, should have been more specific. I was referring to the gnome calculator: https://wiki.gnome.org/Apps/Calculator

Re: SpeedCrunch

#52

SpeedCrunch looks very promising, and I've used it a lot in the past. I'm sad to see that they still haven't released the order of operations bug fix [0] they made in 2017. SpeedCrunch does some operations in an order most people wouldn't expect. For example, SpeedCrunch says 1/2(-9.8) = -0.05102040816326530612 [0] - https://bitbucket.org/heldercorreia/speedcrunch/commits/ac49...

Is that not correct? I guess I should touch on my order of operations. I thought distributing was part of the parenthesis step, that came before MDAS.

Yes, that answer is incorrect since it breaks with calculator conventions. The contents of the parentheses are calculated first (P in PEMDAS), and then the multiplication is done later (MD in PEMDAS). Implicit multiplication (which does not explicitly use a multiplication sign) has the same priority as any other multiplication:

  a/b(c) = a/b*c = (a/b)*c
Since SpeedCrunch only accepts input in a single line, this would be the least unexpected way to interpret the expression, and consistent with how graphing calculators operate.

A horizontal fraction bar, which SpeedCrunch does not support (since it only accepts single-line input), implies parentheses around the numerator and denominator. For example:

  ax
  -- = (ax)/(by) = (a*x)/(b*y)
  by
compared to

  ax/by = a*x/b*y = ((a*x)/b)*y
(If the above is not displayed correctly, please view this comment on the HN website.)

Implicit multiplication is a point of frequent confusion:

- https://www.nytimes.com/2019/08/05/science/math-equation-pem...

- https://www.themathdoctors.org/order-of-operations-implicit-...

To guarantee that the expression does not get misinterpreted, the person writing the expression should always add parentheses/brackets and explicit multiplication signs, or use horizontal division bars where possible, to make the expression unambiguous.

Re: SpeedCrunch

#53

SpeedCrunch looks very promising, and I've used it a lot in the past. I'm sad to see that they still haven't released the order of operations bug fix [0] they made in 2017. SpeedCrunch does some operations in an order most people wouldn't expect. For example, SpeedCrunch says 1/2(-9.8) = -0.05102040816326530612 [0] - https://bitbucket.org/heldercorreia/speedcrunch/commits/ac49...

Is that not correct? I guess I should touch on my order of operations. I thought distributing was part of the parenthesis step, that came before MDAS.

According to the mainstream interpretation, a/b(c) parses to:

    (* (/ a b) c)
and not:

    (/ a (* b c))
It's very ambiguous, though. No scientist would ever write expressions like that.

Re: SpeedCrunch

#55

A small plug for my own script: I'm proud to present the most useful, least-work script I've ever written: `math` https://github.com/shawwn/scrap/blob/master/math #!/bin/sh scale=4 # results will print to the 4th decimal echo "scale=$scale; $@" | bc -l It just yeets all its arguments into bc -l, so you can run math 1+2-3 or math '(1024 - 7)*10' or whatever else you want. I even use it in other shell scripts, since ba…

> I miss MsPaint every day.

I’m like you. On Linux there’s KolourPaint that does the job, but on macOS I never found any desktop app that does what I want. In the browser, there’s this clone [1] that mimicks all the features of the original one. You can "open" a file, "save" it, and everything in the meantime is saved in local storage.

[1]: https://jspaint.app/

Re: SpeedCrunch

#56

I used to use this back when I mained Windows. Ever since moving primarily to Linux, and getting familiar with Emacs, Calc mode simply beats every calculator I've ever used in total functionality. However, there are certain cases where I also like to use https://insect.sh if lots of units are involved.

insect.sh is so cool!

``` (6 Mbit / s) × 1.5 h GB = 4.05 GB ```

Love that. Thanks the recommendation.

Re: SpeedCrunch

#57

Earlier quoted context omitted.

Is that not correct? I guess I should touch on my order of operations. I thought distributing was part of the parenthesis step, that came before MDAS.

Yes, that answer is incorrect since it breaks with calculator conventions. The contents of the parentheses are calculated first (P in PEMDAS), and then the multiplication is done later (MD in PEMDAS). Implicit multiplication (which does not explicitly use a multiplication sign) has the same priority as any other multiplication: a/b(c) = a/b*c = (a/b)*c Since SpeedCrunch only accepts input in a single line, this would…

÷ https://en.wikipedia.org/wiki/Division_sign

avoids this entirely.

or if you wanna be really fkn nerdy:

∕, instead of /

Re: SpeedCrunch

#58

SpeedCrunch looks very promising, and I've used it a lot in the past. I'm sad to see that they still haven't released the order of operations bug fix [0] they made in 2017. SpeedCrunch does some operations in an order most people wouldn't expect. For example, SpeedCrunch says 1/2(-9.8) = -0.05102040816326530612 [0] - https://bitbucket.org/heldercorreia/speedcrunch/commits/ac49...

Is that not correct? I guess I should touch on my order of operations. I thought distributing was part of the parenthesis step, that came before MDAS.

The disconnect is that a lot of people mentally treat implicit multiplication with a higher priority than explicit, which is pretty understandable. For instance:

  1/3x
is likely to be understood as 1/(3*x), because otherwise it would’ve been written like x/3. If that’s true, then so surely

  1/3(x) 
should be the same, right?

Smarter people than I have argued both sides of this, and I don’t have a strong opinion except to use parentheses if there’s any possible ambiguity. Just saying, I totally understand why you’d come to that conclusion, and I probably would too.

Re: SpeedCrunch

#59
post #57

Earlier quoted context omitted.

Yes, that answer is incorrect since it breaks with calculator conventions. The contents of the parentheses are calculated first (P in PEMDAS), and then the multiplication is done later (MD in PEMDAS). Implicit multiplication (which does not explicitly use a multiplication sign) has the same priority as any other multiplication: a/b(c) = a/b*c = (a/b)*c Since SpeedCrunch only accepts input in a single line, this would…

÷ https://en.wikipedia.org/wiki/Division_sign avoids this entirely. or if you wanna be really fkn nerdy: ∕, instead of /

Almost every one of those Facebook reposts with an ambiguous math equation features an obelus. It only seems to create confusion.

Re: SpeedCrunch

#60
post #57

Earlier quoted context omitted.

Yes, that answer is incorrect since it breaks with calculator conventions. The contents of the parentheses are calculated first (P in PEMDAS), and then the multiplication is done later (MD in PEMDAS). Implicit multiplication (which does not explicitly use a multiplication sign) has the same priority as any other multiplication: a/b(c) = a/b*c = (a/b)*c Since SpeedCrunch only accepts input in a single line, this would…

÷ https://en.wikipedia.org/wiki/Division_sign avoids this entirely. or if you wanna be really fkn nerdy: ∕, instead of /

You're right. The division sign is also unambigious. Unfortunately, it's not usually found on keyboards so many people are accustomed to using slashes.

SpeedCrunch and other calculator apps still need to have an unambiguous way of interpreting the expression when the user types or pastes in a slash. The apps could convert slashes to division signs before displaying them on the screen, since that's how the symbols should be interpreted. This is how GNOME Calculator resolves the ambiguity.

Post reply on HN