[HN Gopher] SpeedCrunch
       ___________________________________________________________________
        
       SpeedCrunch
        
       Author : hkc
       Score  : 226 points
       Date   : 2021-12-23 13:10 UTC (9 hours ago)
        
 (HTM) web link (speedcrunch.org)
 (TXT) w3m dump (speedcrunch.org)
        
       | Centigonal wrote:
       | This seems really cool (esp. WRT unit conversions), but I'm
       | already pretty entrenched in using Excel, R, or Python for
       | calculations, since I usually already have one or more of those
       | open. Is it worth learning another tool to pick up something like
       | this?
        
         | NathanielK wrote:
         | I find SpeedCrunch can be very useful along side excel once you
         | get a feel for it. Often I use SpeedCrunch's unit conversion
         | and SI prefix features to distill all the magic numbers I need
         | and double check my formula. After that, creating a formula in
         | excell (or another language) to deal convert data in a strange
         | format is easy.
         | 
         | Learning SpeedCrunch is easy if you're already comfortable with
         | single-line calculators. It has autocomplete that will help
         | learn some of the SpeedCrunch specific units. For example,
         | year_julian vs year_tropical, gallon_US vs gallon_UK are
         | slightly different.
        
       | unemphysbro wrote:
       | echo "expression" | bc -l
       | 
       | :)
        
       | clockwork-dev wrote:
       | I love _SpeedCrunch_ , especially for dealing with different
       | bases. For back-of-the-napkin type math, _OpalCalc_ is my
       | favorite.
       | 
       | https://skytopia.com/software/opalcalc/
        
       | QuadrupleA wrote:
       | The Python repl / console also makes a great desk calculator (for
       | those who haven't thought to use it that way) .
        
         | l-p wrote:
         | And with PYTHONSTARTUP you can get creative.
         | 
         | I only use it to display numbers as hex and binary [1] but I'm
         | sure it can be useful in many other ways.
         | 
         | [1]:
         | https://github.com/L-P/dotfiles/blob/39ac8d5849a593ef1633ed8...
        
       | db65edfc7996 wrote:
       | Ever since Windows released their embarrassing touch-friendly
       | calculator app which takes 1+ seconds to start, SpeedCrunch has
       | been my goto across platforms.
       | 
       | I was recently doing some (silly) combinatorical math, where I
       | wanted to know factorial(400_000) and SpeedCrunch happily
       | produced the answer immediately. Incredibly satisfied.
        
       | phoboslab wrote:
       | After trying a lot of different calculators, I just settled on
       | this little shell script to launch/raise a nodejs repl with
       | FN+Backpspace:                 if [ $(xdotool search --name "calc
       | repl") ]; then        xdotool search --name "calc repl"
       | windowraise       else        xfce4-terminal \
       | --title="calc repl" \         --color-bg=#123 \         --color-
       | text=#fec \         --hide-scrollbar \         --font="Deja Vu
       | Sans Mono 14px" \         --geometry 40x14 \         --execute
       | node -i -e "$JSREPL"       fi
       | 
       | ($JSREPL just contains some extra functions that I want in a
       | calculator)
       | 
       | I can easily go back to previous calculations and results, define
       | vars, run loops whatevs. Having it on a key combo and launching
       | the terminal with a distinct text/bg color really makes a
       | difference. It also launches faster than most other calculators I
       | tried. For my purposes (non-scientific, mostly programming
       | stuff), it's been great.
        
       | krylon wrote:
       | I _LOVE_ SpeedCrunch. I do not need a calculator very often, but
       | when I do, this is my calculator of choice. It doesn 't support
       | graphing, but it understands units, which is both useful and
       | cool.
       | 
       | I like the UI, too, for being simple but very much functional
       | without getting in my way. And it supports a persistent history
       | across sessions, which I also like.
        
         | netizen-936824 wrote:
         | Yes, I absolutely _love_ being able to scroll back through my
         | old calculations. It comes in handy so often
        
       | unanimous wrote:
       | 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...
        
         | seanw444 wrote:
         | 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.
        
           | qsort wrote:
           | 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.
        
           | kstrauser wrote:
           | 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.
        
           | commoner wrote:
           | 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.
        
             | Jerrrry wrote:
             | / https://en.wikipedia.org/wiki/Division_sign
             | 
             | avoids this entirely.
             | 
             | or if you wanna be really fkn nerdy:
             | 
             | /, instead of /
        
               | teawrecks wrote:
               | Almost every one of those Facebook reposts with an
               | ambiguous math equation features an obelus. It only seems
               | to create confusion.
        
               | commoner wrote:
               | 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.
        
       | skyfaller wrote:
       | I love SpeedCrunch, but lately I've been using Kalker on the
       | command line: https://kalker.xyz/
       | 
       | It's written in Rust ;-)
        
         | paddim8 wrote:
         | Wait... I made that! Nice
        
       | jicka wrote:
       | Speedcrunch is amazing.
       | 
       | I often have to do many simple calculations (adding numbers from
       | a pdf,...) and having full history and being able to keep
       | speedcrunch over the other windows is perfect. I also increased
       | font-size dramatically to improve readability on big screens.
       | 
       | Sure, there are more advanced tools. But the simplicity and
       | lightness on ressources is what makes it my go-to calculator.
        
       | middleclick wrote:
       | This is one of the tools that I use everyday but I don't
       | appreciate it much because it always works for me and I don't
       | think twice.
       | 
       | Thank you to the authors for working on it. Time to send them a
       | donation!
        
       | msravi wrote:
       | 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 also gets it wrong.
        
         | hatsuseno wrote:
         | 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.
        
           | msravi wrote:
           | Sorry, should have been more specific. I was referring to the
           | gnome calculator: https://wiki.gnome.org/Apps/Calculator
        
       | B-Con wrote:
       | I've been using this as my Linux GUI calculator for a while
       | (maybe a decade?). It's a good blend of functionality and
       | simplicity and after I started using it I literally haven't
       | looked for anything else.
        
         | bjoli wrote:
         | I believe it was default in kubuntu at some time. Or at least
         | heavily pushed.
        
       | yboris wrote:
       | I _love_ SpeedCrunch on Windows, but for MacOS I prefer _Numi_
       | 
       | https://numi.app/
        
         | crispyalmond wrote:
         | How does Numi compare to Soulver 3[0]?
         | 
         | [0] https://soulver.app/
        
           | tksb wrote:
           | I have your exact question in mind. If the OP hasn't tried
           | Soulver, they must! It's a gem of computing for me and I lean
           | on it regularly.
        
           | kstrauser wrote:
           | I have a single, but major, complaint with Soulver: version 3
           | for iOS/iPadOS doesn't exist yet. There are a lot of
           | calculations I'd want to do both at my desk and out on the
           | road, and I'd like them synced. Calca handles that pretty
           | well and I've been using it over Soulver lately for that one
           | specific reason. I like Soulver more than Calca, though, and
           | the second Soulver 3 for iOS comes along I'll switch back.
        
       | faffernot wrote:
       | Am I a weirdo for using the console (F12) in my browser for
       | calculating stuff like tips, rent/utilities for the month, and
       | other such things? Lol.
        
         | atdrummond wrote:
         | Seeing as others in this thread use the bog standard console -
         | and I've seen other developers do exactly what you're
         | referencing - it seems such console usage isn't unique to you
         | at the very least.
        
         | taviso wrote:
         | No, I always use gdb :)
         | 
         | It also has a persistent history, variables, functions, base
         | conversion, etc. I guess it doesn't have unit conversion or a
         | math library, but it's a great programmers calculator.
        
           | eichin wrote:
           | Hah, I used gdb print expression for a calculator for decades
           | (especially p/x for hex conversions.) I finally switched to
           | "just fire up a python repl instead" around 2010...
        
       | cyounkins wrote:
       | Also in this space is insect: https://github.com/sharkdp/insect
       | and https://www.insect.sh/
        
         | nusaru wrote:
         | This is from the same guy who made fd and bat!
        
       | seanw444 wrote:
       | 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.
        
         | CyberShadow wrote:
         | Emacs Calc (not unlike much of the rest of Emacs) is a little
         | ... special. By default, it calculates 4/2*2 as 1, because
         | multiplication has a higher precedence than division.
         | 
         | https://orgmode.org/manual/Formula-syntax-for-Calc.html
        
           | bufferoverflow wrote:
           | > _because multiplication has a higher precedence than
           | division_
           | 
           | Wow. That's actually quite bad.
        
         | ezekg wrote:
         | This may be slightly off topic, but what are some other small,
         | lesser known websites like this one that people use regularly?
         | For me, it'd be https://rubular.com and https://crontab.guru.
         | I've used those 2 sites pretty regularly across my entire
         | career.
        
         | xwowsersx wrote:
         | insect.sh is so cool!
         | 
         | ``` (6 Mbit / s) x 1.5 h GB = 4.05 GB ```
         | 
         | Love that. Thanks the recommendation.
        
         | marcosdumay wrote:
         | You may like qalc. It's an apt-get away and does all those
         | units.
        
       | widea wrote:
       | One thing I do not like about Speedcrunch: there is a slight
       | delay between pressing enter and showing the result, just enough
       | to be noticed.
        
         | jicka wrote:
         | Try clearing your history. I notice the delay only when I have
         | dozens / hundreds of steps in history.
        
           | widea wrote:
           | That solved it, thanks! :-) Now I have nothing but good words
           | about Speedcrunch!
        
             | hatsuseno wrote:
             | Except maybe that long histories create noticeable lag,
             | that is.
        
         | crispyalmond wrote:
         | I just installed it to try it out and I love the idea but this
         | is the worst part about it. Even with no history as another
         | said, it still has a delay.
        
           | crispyalmond wrote:
           | Looks like my delay happens when converting between units.
           | It's almost like it prompts me to confirm when I press Enter
           | so I end up having to hit it twice. Other than this it is
           | really great.
        
       | mpyne wrote:
       | Fun fact about SpeedCrunch history, the software descends from an
       | off-hand blog post by Roberto Alsina, a KDE developer,
       | complaining about KCalc usability [1]. Back then developers were
       | often just unthinkingly cloning 'skeuomorphic' interfaces like
       | Apple used back then, designing user interfaces that resembled
       | physical objects instead of taking advantage of the opportunities
       | afforded by computers.
       | 
       | His blog post elicited several rapid responses from developers
       | taking his PyQt-based mockup and turning it into a 'real'
       | application ([2], [3]). One of those was Ariya Hidayat's
       | "SpeedCrunch", which has been actively maintained up to the
       | present day. I can't find Ariya's original 2004 announcement, I
       | think the original link was
       | http://ariya.pandu.org/blog/archives/2004/10/calculator-feve...
       | but that's dead now.
       | 
       | But it's really neat to see how this all started from a day or
       | two of hacking on a solution to a simple problem.
       | 
       | [1] https://ralsina.me/stories/33.html [2]
       | https://ralsina.me/weblog/posts/P245.html [3]
       | https://ralsina.me/weblog/posts/P247.html
        
       | driminicus wrote:
       | This looks cool! I have been using qalculate
       | (https://qalculate.github.io/) recently, which seems similar. Has
       | anyone used both and can tell me how they compare?
        
         | wiz21c wrote:
         | SpeedCrunch is less powerful but I find its interface much
         | easier to understand. SpeedCrunch is really nice. It'd be nice
         | if it was a tad more powerful (for example, to plot quick
         | graphs)
        
       | ajot wrote:
       | I've used it in the past, until one day they removed the
       | buttons/skeuomorphic UI. A couple of years ago, I found it again
       | and is now my daiky driver. It has a newer skeuomorphic
       | interface, which I only use if I can't remember the name of a
       | function.
       | 
       | What I like the most is the seamless integration of different
       | notation styles, mainly using commas and points as decimal
       | separators.
        
       | morpheuskafka wrote:
       | I loved this on Windows but haven't used it since switching to
       | macOS since it seems to not support Retina screens very well,
       | anyone know of a workaround?
        
       | Aaronmacaron wrote:
       | Love it. Use it as my default calculator when I need one
       | occasionally. I would love to see support for plotting graphs and
       | solving equations. Also a more touch friendly UI would be nice
       | when using my 2-in1 laptop in tablet mode when doing math
       | excercises for uni.
        
       | bitigchi wrote:
       | Their macOS download link is broken. Oh well.
        
       | gravypod wrote:
       | This looks great but I wish it had some of the features that NaSC
       | [0] has. It's a really amazing tool but it's awfully crashy to
       | the point where it's barely usable. That being said being able to
       | say `solve(... = 512 MiB)` and getting an answer is unbelievably
       | amazing.
       | 
       | [0] - https://appcenter.elementary.io/com.github.parnold-x.nasc/
        
       | dan-robertson wrote:
       | Their demo of their efficient interface compared to GNU Calc:
       | SC: 5+8 Enter [4 keys, 1 shift]       Calc: 5 RET 8 + [4 keys, 1
       | shift]       SC: 5*(113+23) Enter [11 keys, 3 shifts]       Calc:
       | 5 RET 113 RET 23 + * [10 keys, 1 shift]       SC: 7*ans Enter [6
       | keys, 1 shift]       Calc: 7 * [2 keys, 1 shift]       SC:
       | sqrt(1231+41) Enter [14 keys, 3 shift]       Calc: 1231 RET 41 +
       | Q [9 keys, 1 shift]
       | 
       | Maybe it's more efficient than clicking buttons with a mouse but
       | it doesn't feel more efficient than the calculator I already use,
       | nor does it seem to be better integrated with the software I use.
       | It doesn't even seem more efficient than the scientific
       | calculator I used in high school.
       | 
       | I think I'm put off more by the lack of graphing and (as far as I
       | could tell skimming their site) array/vector/matrix functions,
       | which are the main things I do with Calc.
        
         | atdrummond wrote:
         | I don't have a horse in the race (I find myself still using the
         | default of whatever OS I'm using more often than I specifically
         | choose SC) but I will say that one can easily configure SC to
         | operate with past calculated results and other references from
         | previous operations, just as you did with your cited GNUCalc
         | examples. If such shortcuts are utilised, one will find SC
         | requires the same number keystrokes - or fewer.
        
         | JoshTriplett wrote:
         | You're comparing infix with RPN. There are more factors there
         | than just number of keystrokes; not everyone enjoys working
         | with RPN or finds it comfortable. RPN is a deliberate tradeoff
         | in favor of speed/efficiency at the expense of other things.
        
       | themodelplumber wrote:
       | Whoa, I didn't realize it had color themes and font options on
       | top of everything else. I just subbed it in for my normal
       | calculator software shortcut, this is great. Thanks for posting
       | op.
       | 
       | (Edit: The HTML export feature even preserves the color theme.
       | It's a web publishing tool now! Hahaha)
        
       | [deleted]
        
       | sillysaurusx wrote:
       | 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 bash's math facilities are
       | rather limited and inconsistent across sh vs bash.
       | :~$ echo $(((3+4)*5))       35       :~$ echo $(((3+4)*5/1024))
       | 0       :~$ math '((3+4)*5/1024)'       .0341
       | 
       | It has all the precision you want, as long as you only want
       | results up to the 4th decimal.
       | 
       | It's surprising how much I use it. I find myself absentmindedly
       | typing out math 220*1024*1024 while talking to people in meetings
       | (what, you don't have meetings where it's crucial to know how
       | quickly 220MB can be transferred?) and like thousands of other
       | situations.
       | 
       | Meanwhile, funny story: I bought an iPad recently, and discovered
       | that it's a delightful way to pass the time while shopping. You
       | can stick it in your cart and pull up 3blue1brown and zone out
       | while getting your pineapples. So I was doing that, and I went to
       | reach for the calculator app to figure something out, and
       | discovered that there is no calculator on iPads.
       | 
       | The punchline is that if you want a calculator on an iPad, it'll
       | either cost you $5 or your soul: https://i.imgur.com/CJsDtB0.jpg
       | 
       | Someone _please_ make SpeedCrunch, but MsPaint. I miss MsPaint
       | every day. There 's an OS X app called Paintbrush which is
       | similar, but unfortunately quite buggy and somehow even more
       | limited in certain respects. Being able to just paste a
       | screenshot and draw a red circle within 5 seconds is something
       | that I wish we could do in 2022. Nay, I say that it's our right
       | as programmers to be able to do that. </rallying cry>
       | 
       | EDIT: formatting. TIL you can backslash-escape asterisks on HN.
        
         | namanyayg wrote:
         | I use Flameshot for screenshots. Onpaste (web) is good too.
        
         | hk__2 wrote:
         | > 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/
        
       | parentheses wrote:
       | `bc` would be great interactively
        
       | granddave wrote:
       | This is a great piece of software that's installed on all my
       | machines!
        
         | NathanielK wrote:
         | That's one of my favourite parts of free software. No worries
         | about licensing, any computer I pull out of a dumpster gets a
         | full suite of powerful software I'm familiar with.
        
         | [deleted]
        
       | zokier wrote:
       | It would be nice to know how numeric types are implemented,
       | especially for something advertised as _high-precision_. Does it
       | use some arbitrary precision floats or what?
        
         | hatsuseno wrote:
         | From the documentation: * However, only about 78 significant
         | digits are stored at any point. * SpeedCrunch stores integers
         | with a precision of up to 256 bits.
        
       | NathanielK wrote:
       | A little bit jank, but there is also a port for android
       | available[0]. It still has SI prefixes and unit conversion, but
       | you need to have a good keyboard to really take advantage of it.
       | [0] https://github.com/mikkosyrja/speedcrunch-android
        
       | TomGullen wrote:
       | Is a decent scientific calculator simply a missing feature on
       | Google?
        
       | [deleted]
        
       ___________________________________________________________________
       (page generated 2021-12-23 23:00 UTC)