News for hackers. Stuff that matters.
Re:Calc.exe is now open source; there’s surprising depth in ... by userbinator on Thursday March 25, 2021 @09:33AM (#26580018)
This is the "modern" one with the egregiously bloated UI (including a loading screen!) and telemetry... but funny that it's using the same calculation code. Of course they still managed to screw it up somehow: https://news.ycombinator.com/item?id=17670644

In one of the old Win2k source leaks the code can be found for the far more efficient "classic" one.

Also, title needs (2019). There are some other HN articles from around that time discussing it: https://news.ycombinator.com/item?id=19321217

Re:Calc.exe is now open source; there’s surprising depth in ... by contextfree on Thursday March 25, 2021 @09:47PM (#26587965)
The loading screen technically isn't part of the calculator's UI - Windows automatically shows a loading screen for all new (UWP) apps unless they explicitly opt out (and even then the OS will still show the loading screen if the app takes more than a second to load). The purpose of this is to keep the OS feeling responsive, since it allows it to bring up the window immediately (for UWP apps the OS shell is in charge of creating and managing apps' window frames, unlike Win32 where it's the apps' responsibility), rather than leaving the user staring at a screen with nothing happening for several seconds (and maybe thinking it's the OS's fault for being unresponsive)
Re:Calc.exe is now open source; there’s surprising depth in ... by thwarted on Thursday March 25, 2021 @10:20PM (#26588157)
for UWP apps the OS shell is in charge of creating and managing apps' window frames, unlike Win32 where it's the apps' responsibility

Sounds like the linux ecosystem moved to client-side-decorations, and Windows moved to a window manager model.

Re:Calc.exe is now open source; there’s surprising depth in ... by userbinator on Thursday March 25, 2021 @11:16PM (#26588427)
Regardless of whether it is or isn't part of the calculator's UI, the presence of a loading screen for a calculator is a symptom of a deeply-rooted problem.
Re:Calc.exe is now open source; there’s surprising depth in ... by keithalewis on Friday March 26, 2021 @06:34PM (#26597829)
It's funny what people tell you about themselves if you just listen.
Re:Calc.exe is now open source; there’s surprising depth in ... by sellyme on Thursday March 25, 2021 @11:48PM (#26588570)
> The purpose of this is to keep the OS feeling responsive, since it allows it to bring up the window immediately, rather than leaving the user staring at a screen with nothing happening for several seconds

Wait, you only get one of those? As of about a month ago on my computer, launching calc.exe takes 5-6 seconds for anything to happen and I'm then greeted 1-2 seconds of a loading screen after the window appears.

I've taken to just leaving an IDLE shell open at this point.

Re:Calc.exe is now open source; there’s surprising depth in ... by tyingq on Thursday March 25, 2021 @09:42AM (#26580150)
Open sourcing it seems to be working. Several of the open pull requests fix bad math: https://github.com/microsoft/calculator/pulls
Re:Calc.exe is now open source; there’s surprising depth in ... by capableweb on Thursday March 25, 2021 @02:44PM (#26583841)
Seems there are 4 pull requests open to fix various math issues, all of them opened in 2019. Most PR merges seems to be about minor changes like translations and version bumps. Not sure we can call it a success just yet.

It's very cool it's open source in the first place though, don't get me wrong. And MS doesn't have to merge fixes if they don't want to of course.

Re:Calc.exe is now open source; there’s surprising depth in ... by ancarda on Thursday March 25, 2021 @05:27PM (#26585617)
A loading screen and telemetry? For a fucking calculator?

What happened to software...

Re:Calc.exe is now open source; there’s surprising depth in ... by Nextgrid on Thursday March 25, 2021 @08:31PM (#26587499)
But what about growth and engagement? I wouldn't be surprised if some idiot's performance metrics are tied to how many people "engage" with the calculator.
Re:Calc.exe is now open source; there’s surprising depth in ... by benttoothpaste on Saturday March 27, 2021 @09:57AM (#26602297)
Next step: contextual ads. “Looks like you are trying to calculate your taxes. Click here for $10 off of Turbo Tax!”
Re:Calc.exe is now open source; there’s surprising depth in ... by thebruce87m on Thursday March 25, 2021 @06:27PM (#26586390)
At least it’s not a subscription model for £6.99/month like almost all of the apps you find on the app stores that used to be either free or a one-time £X.
Re:Calc.exe is now open source; there’s surprising depth in ... by koolba on Thursday March 25, 2021 @07:26PM (#26586951)
You get the addition and subtraction for free, but you have to upgrade via in app purchase for multiplication or division. It makes sense because those are advanced features the average user wouldn’t need anyway.
Re:Calc.exe is now open source; there’s surprising depth in ... by laurent92 on Thursday March 25, 2021 @07:41PM (#26587079)
Yes, and if the average user really needs it from time to time, they can use + several times.
Re:Calc.exe is now open source; there’s surprising depth in ... by edgyquant on Thursday March 25, 2021 @11:22PM (#26588451)
Besides you can multiply for free, just add N number of times. Multiplication is a quality of life improvement, not a necessity
Re:Calc.exe is now open source; there’s surprising depth in ... by tomaskafka on Thursday March 25, 2021 @07:38PM (#26587052)
I see that you tried to look for a calculator app for iPad (no, there is still no built-in one).
Re:Calc.exe is now open source; there’s surprising depth in ... by gfxgirl on Thursday March 25, 2021 @09:18PM (#26587811)
That's because you're supposed to pull out your iPhone to use as a calculator.
Re:Calc.exe is now open source; there’s surprising depth in ... by abhinav22 on Friday March 26, 2021 @07:20AM (#26590755)
Re:Calc.exe is now open source; there’s surprising depth in ... by egypturnash on Thursday March 25, 2021 @09:57PM (#26588034)
Calcbot does a pretty good job of Not Sucking. I think it's a couple bucks, I don't know, I paid for it ages ago.
Re:Calc.exe is now open source; there’s surprising depth in ... by wlesieutre on Thursday March 25, 2021 @10:54PM (#26588321)
Did you find PCalc?
Re:Calc.exe is now open source; there’s surprising depth in ... by carrja99 on Thursday March 25, 2021 @09:00PM (#26587707)
I still cannot get over that. A calculator with ads.
Re:Calc.exe is now open source; there’s surprising depth in ... by 8note on Thursday March 25, 2021 @09:43PM (#26587945)
I defs paid for the ti-calc emulator, but that gets me my ti-89 experience, and the emulator didnt cost me 200 bucks
Re:Calc.exe is now open source; there’s surprising depth in ... by cblconfederate on Thursday March 25, 2021 @07:37PM (#26587039)
Sqrt() is a subscription service if you want more than 2 decimal points
Re:Calc.exe is now open source; there’s surprising depth in ... by chihuahua on Thursday March 25, 2021 @07:40PM (#26587072)
There are now cars where the heated seats are a subscription service. https://www.autoguide.com/auto-news/2020/07/bmw-wants-to-tur...
Re:Calc.exe is now open source; there’s surprising depth in ... by ddingus on Thursday March 25, 2021 @11:45PM (#26588551)
I would say, "unbelievable!", but sadly, yeah this garbage is only going to grow like a cancer.

So, no. Not for me.

Re:Calc.exe is now open source; there’s surprising depth in ... by 8note on Thursday March 25, 2021 @09:46PM (#26587963)
That gives me the feeling there's good business in modifying BMWs to connect the heated seats wires to a physical switch with a light on it
Re:Calc.exe is now open source; there’s surprising depth in ... by anoncake on Thursday March 25, 2021 @11:20PM (#26588438)
That's piracy. You wouldn't download a car [seat]!
Re:Calc.exe is now open source; there’s surprising depth in ... by ancarda on Thursday March 25, 2021 @07:51PM (#26587166)
i don't want to live on this planet anymore.gif
Re:Calc.exe is now open source; there’s surprising depth in ... by cblconfederate on Friday March 26, 2021 @04:08AM (#26589787)
They give the seats for free, they must monetize them somehow, understandable
Re:Calc.exe is now open source; there’s surprising depth in ... by rsj_hn on Friday March 26, 2021 @06:12AM (#26590405)
math obsessed kid bankrupts parents by purchasing digits of pi.
Re:Calc.exe is now open source; there’s surprising depth in ... by nullsense on Friday March 26, 2021 @04:10AM (#26589798)
Need more than 5 decimal points? Contact us for pricing.
Re:Calc.exe is now open source; there’s surprising depth in ... by gogopuppygogo on Thursday March 25, 2021 @10:27PM (#26588190)
They stopped charging for it. At least for the upgrade when it launched.

The user became the product.

Windows collects user behavior and sells ads.

You can still buy whatever they call Windows LTSB this week if you hate this.

Re:Calc.exe is now open source; there’s surprising depth in ... by Nextgrid on Friday March 26, 2021 @06:01AM (#26590366)
Buying LTSB is extremely difficult and annoying. It's not just a matter of entering card details and getting back a product key + ISO.
Re:Calc.exe is now open source; there’s surprising depth in ... by krapp on Thursday March 25, 2021 @08:00PM (#26587257)
folders in Windows have loading bars now. Folders with nothing but text files in them. It's insane.
Re:Calc.exe is now open source; there’s surprising depth in ... by dfox on Thursday March 25, 2021 @09:16PM (#26587804)
Explorer UI is capable of showing loading animation for folder contents since it was first publicly released. It makes sense not only in context of potentially slow devices, but also because "Folder" is not an "Directory" but an somewhat arbitrary COM object and thus showing contents of folder can lead to a lot of potentially slow operations.

IIRC somewhere along the line of all the Win32 windows versions the loading animation got somewhat broken and explorer window was more likely to get simply unresponsive instead of displaying loading animation, but that is another story.

Re:Calc.exe is now open source; there’s surprising depth in ... by jasdine817 on Friday March 26, 2021 @08:43PM (#26598709)
Folders in Windows can be network locations or internet locations without any guarantees on their access speed, makes sense to show to the user that it's still doing something.
Re:Calc.exe is now open source; there’s surprising depth in ... by p_l on Sunday March 28, 2021 @09:15AM (#26610075)
A big part of that loading bar, outside of network ops and slow drives (and remember, today you don't have floppy drive noise to know if it works or got hung), is for things like sorting and getting file icons and other attributes right. This can take non-trivial amount of time.
Re:Calc.exe is now open source; there’s surprising depth in ... by tyingq on Thursday March 25, 2021 @10:34AM (#26580790)
Someone did repackage the old Win7/Prior version of calc.exe here: https://win7games.com/#calc
Re:Calc.exe is now open source; there’s surprising depth in ... by MarkSweep on Thursday March 25, 2021 @05:24PM (#26585577)
They still have the old calc.exe from Windows 7 in the source tree. You get it if you the LTSC version of Windows. I wish there was a way to get it on regular Windows.

They seem to be going the other direction; notepad.exe is now updated from the App Store in the Dev channel.

Re:Calc.exe is now open source; there’s surprising depth in ... by tediousdemise on Thursday March 25, 2021 @06:58PM (#26586706)
You can also get the old calc on other versions of Windows if you use Chocolatey: https://chocolatey.org/packages/oldcalc
Re:Calc.exe is now open source; there’s surprising depth in ... by signal11 on Thursday March 25, 2021 @08:45PM (#26587602)
This code is MIT licensed, it should be possible for someone to re-create the old UI and still use this calculator's modern calculation engine (with all the bugfixes)?
Re:Calc.exe is now open source; there’s surprising depth in ... by molticrystal on Thursday March 25, 2021 @05:58PM (#26586007)
I did a casual browse of the repo and likely keep overlooking the windows 7 build.

Hoping you could point out how to build it or where it is hiding.

Re:Calc.exe is now open source; there’s surprising depth in ... by glsdfgkjsklfj on Thursday March 25, 2021 @06:04PM (#26586092)
I don't think they meant "this released source tree" but as in "microsoft's source tree" since it is still actively maintained for the LTSC release channel.

This is for the new calculator only.

Re:Calc.exe is now open source; there’s surprising depth in ... by bscphil on Thursday March 25, 2021 @08:18PM (#26587399)
Thanks for that link. The forum thread is perhaps the most perfect example of how terrible technology forums tend to be that I've ever seen: if you report a problem, some fanboy with over 10,000(!) posts will immediately show up to tell you it's your fault and not really a problem:

> Do you really think it is going to make much difference to the final answer?

> Even the algorithms used are probably only accurate to so many significant figures.

Beautiful. (Keep in mind the issue referred to here only requires five decimal digits to show up.)

Re:Calc.exe is now open source; there’s surprising depth in ... by swiley on Thursday March 25, 2021 @09:46AM (#26580191)
A loading screen?

You're probably better off just using a REPL at that point.

Re:Calc.exe is now open source; there’s surprising depth in ... by zrobotics on Thursday March 25, 2021 @10:18AM (#26580585)
Eh, if you launch python in powershell there is still a loading delay, since powershell for some crazy reason takes like 30s to launch on a default win10 installation.
Re:Calc.exe is now open source; there’s surprising depth in ... by vetinari on Thursday March 25, 2021 @10:48AM (#26580958)
You must have something very wrong; neither Windows Powershell nor Powershell 7 takes 30s to launch.

But anyway, for a quick calc, is there anything faster than Spotlight (for mac)/Gnome shell (for linux)/Powertoys Run (for windows)? Instead of app name you are going to launch, just punch in your expression.

Re:Calc.exe is now open source; there’s surprising depth in ... by Narishma on Thursday March 25, 2021 @05:13PM (#26585454)
Not the person you responded to but I have the same experience with Powershell as them. I just checked again to be sure and it takes 20s to start and become usable on my laptop. CMD.EXE, in comparison, starts instantly.
Re:Calc.exe is now open source; there’s surprising depth in ... by Shared404 on Thursday March 25, 2021 @08:31PM (#26587496)
I'll be the next to confirm this, and on multiple machines.

Maybe 1 in 5 that I try will be a reasonable startup time.

Re:Calc.exe is now open source; there’s surprising depth in ... by vetinari on Friday March 26, 2021 @06:17AM (#26590427)
That's interesting, it seems quite widespread.

I'm getting 1-2s on my machines, both just plain powershell and powershell inside windows terminal. No enterprise crap running though, just Defender.

Re:Calc.exe is now open source; there’s surprising depth in ... by Shared404 on Tuesday March 30, 2021 @02:41PM (#26638559)
It got bad enough I wrote a (now unused) script in batch instead of Powershell. Also having to explicitly enable scripting for each machine was a pain, though understandable.
Re:Calc.exe is now open source; there’s surprising depth in ... by jermaustin1 on Thursday March 25, 2021 @12:37PM (#26582368)
All this time I've been launching calculator and I could have just done it in spotlight...

Why don't they tell you that after you've launched calculator for the 20th time in an hour.

Re:Calc.exe is now open source; there’s surprising depth in ... by majkinetor on Thursday March 25, 2021 @11:01AM (#26581116)
Probably very slow disk (VM?) or Windows Defender ? Or too much modules ?
Re:Calc.exe is now open source; there’s surprising depth in ... by cptskippy on Thursday March 25, 2021 @10:49AM (#26580968)
I shudder to think what you're running Windows 10 on because it only takes 2 seconds to come up on this Celeron 2957U I'm using to browse the internet.
Re:Calc.exe is now open source; there’s surprising depth in ... by yakubin on Thursday March 25, 2021 @01:28PM (#26582986)
I'm running Windows 10 on a Ryzen 5 with 16GB of RAM and an NVMe drive. Powershell takes something between 0.5 to 1 second to start. The first ~20-30 seconds after the start it feels sluggish when doing simple tasks like listing directory contents. It makes it very unpleasant to use.
Re:Calc.exe is now open source; there’s surprising depth in ... by CamperBob2 on Thursday March 25, 2021 @04:38PM (#26585077)
Sluggish behavior during and just after Windows startup is sometimes caused by mapped network drives that no longer resolve. Worth checking if you haven't already.
Re:Calc.exe is now open source; there’s surprising depth in ... by yakubin on Friday March 26, 2021 @07:34AM (#26590835)
I'm talking about Powershell startup, not Windows startup.
Re:Calc.exe is now open source; there’s surprising depth in ... by Jtsummers on Thursday March 25, 2021 @10:58AM (#26581087)
If it's a corporate system like my (presently only) Windows machine then I wouldn't be surprised. They manage to configure these things so they're as fast as a Pentium 133MHz processor from 25 years ago, even though you've got an 8-core i7 with 32GB of RAM.
Re:Calc.exe is now open source; there’s surprising depth in ... by cptskippy on Thursday March 25, 2021 @05:11PM (#26585432)
I wouldn't either, our devs were given the standard issue Lenovo T480 which would have been mostly fine were it not for the fact that we had Raytheon ForcePoint DLP, LANDesk, Trend Micro Apex, WebSense, Cisco Amp, Cisco Umbrella, and who knows what else watching everything we did.

It took upgrading to i9s to get something that could run Teams and Outlook at the same time without audio stuttering during a voice call.

Re:Calc.exe is now open source; there’s surprising depth in ... by zokier on Thursday March 25, 2021 @02:12PM (#26583497)
why would you launch powershell to launch python? you can just launch python directly?
Re:Calc.exe is now open source; there’s surprising depth in ... by swiley on Thursday March 25, 2021 @05:25PM (#26585594)
powershell is slow, just use a console window.

Or maybe starting anything on modern windows is slow.

Re:Calc.exe is now open source; there’s surprising depth in ... by astura on Thursday March 25, 2021 @11:05PM (#26588375)
Huh? I use powershell every single day at work and it loads instantly for me.
Re:Calc.exe is now open source; there’s surprising depth in ... by Aerroon on Thursday March 25, 2021 @05:07PM (#26585397)
I've started using the browser console window more and more as a calculator. The only downsides are the a longer syntax (eg can't do 3^2) and that it is a tab in the browser. Variables and other such things are very useful.
Re:Calc.exe is now open source; there’s surprising depth in ... by PeterisP on Thursday March 25, 2021 @06:33PM (#26586451)
Why the console window? For basic math things that I sometimes need, I just enter stuff in the search/address bar, and it pops DDG or Google or whatever with the answer; and even your own example of "3^2" works there as-is.
Re:Calc.exe is now open source; there’s surprising depth in ... by nick_g on Thursday March 25, 2021 @05:35PM (#26585714)
I also often use the browser console for this as well. Just as a quick tip, you can use ** for exponentiation (e.g. 3**2 === 9)
Re:Calc.exe is now open source; there’s surprising depth in ... by chaorace on Thursday March 25, 2021 @06:24PM (#26586355)
I just have a hotkey that opens a Node CLI. I know some people who do a similar thing with Python, but I think JS is better at composing quick one-liners.
Re:Calc.exe is now open source; there’s surprising depth in ... by squarefoot on Thursday March 25, 2021 @10:18AM (#26580591)
To bad it's the new one. I still recall the Win3.1 (or possibly 3.11 WFW) calc.exe returning 0 when calculating 2.11 - 2.1 . I've always been curious to know what could have triggered that error since it was too big to remain unnoticed for so much time.
Re:Calc.exe is now open source; there’s surprising depth in ... by tyingq on Thursday March 25, 2021 @10:58AM (#26581077)
I tried it in the "Archive.org Windows 3.11 in a browser" and it returns "0.01".

https://archive.org/details/win3_stock

Re:Calc.exe is now open source; there’s surprising depth in ... by tyingq on Thursday March 25, 2021 @04:47PM (#26585173)
Ah, now confirmed...exists in Windows 3.1, fixed in 3.11

You can try Windows 3.1 here: https://www.pcjs.org/software/pcx86/sys/windows/3.10/

And, indeed, 2.11 - 2.1 = 0.00

But, if you then add 1.0, you get 1.01. So the right value is there somewhere.

Re:Calc.exe is now open source; there’s surprising depth in ... by tyingq on Friday March 26, 2021 @10:23AM (#26592503)
There was a dead comment from another HN person that was actually quite helpful here. Not sure why it was dead, so here's a copy/paste:

"It was fixed in this update for Windows 3.1, which switched away from floating point: https://jeffpar.github.io/kbarchive/kb/124/Q124345/"

Re:Calc.exe is now open source; there’s surprising depth in ... by yuhong on Friday March 26, 2021 @02:42AM (#26589387)
It was fixed in this update for Windows 3.1, which switched away from floating point: https://jeffpar.github.io/kbarchive/kb/124/Q124345/
Re:Calc.exe is now open source; there’s surprising depth in ... by idatum on Thursday March 25, 2021 @02:35PM (#26583735)
Here's another test I do with calculator apps (in radians): Pi - 4 * ATAN(1)

These apps really should produce 0 for this and avoid floating point issues. Most of us understand why it wouldn't. To me it's an experience/quality issue.

For what it's worth, the default Android calc app produces 0 (as well as nice RPN apps like Droid48).

Re:Calc.exe is now open source; there’s surprising depth in ... by dhosek on Thursday March 25, 2021 @03:12PM (#26584167)
My go to calculator is spotlight search on my mac. Pleased to announce that it gives 0 for this.
Re:Calc.exe is now open source; there’s surprising depth in ... by Sharlin on Thursday March 25, 2021 @05:31PM (#26585667)
The macOS calculator, on the other hand, has a totally ridiculous bug: it displays "Not a number" for any negative number that you try to take e^x of. 2^x and 10^x work fine, as does using the x^y button with base e. Typing "e^(-whatever)" on the Spotlight search works, as does e^x of -whatever in the iOS calculator app.
Re:Calc.exe is now open source; there’s surprising depth in ... by jimmaswell on Thursday March 25, 2021 @05:29PM (#26585641)
I just use a wolframalpha for everything these days. It uses symbolic computation so there's no possibility for problems like this, and it's a lot more powerful than any built-in calculator app. Almost anything can be typed in one line with natural English directives like "300mi/14mpg * $2.7/gal to Euros". Especially convenient with a browser keyword.
Re:Calc.exe is now open source; there’s surprising depth in ... by aib on Thursday March 25, 2021 @05:39PM (#26585762)
Check out Qalculate![1] for a program that does that and much more (though obviously not as much as WA).

1: http://qalculate.github.io/

Re:Calc.exe is now open source; there’s surprising depth in ... by patwolf on Thursday March 25, 2021 @06:19PM (#26586285)
I usually use Google for quick calculations but get annoyed when it only returns large results in scientific notation. WolframAlpha gives results in just about every conceivable way, e.g. "7 trillion" or "7 000 000 000 000" instead of 7e+12. Much nicer for someone like me who isn't used to scientific notation.
Re:Calc.exe is now open source; there’s surprising depth in ... by dhosek on Friday March 26, 2021 @10:18AM (#26592449)
But Spotlight is just cmd-space away at all times. My only complaint is that I can't get results for date-based queries like "days since 17 Jan 2021" or "50 days from today" and I have to go to Google for those although I can at least just hit return after entering the query to have the result pop up in Safari.
Re:Calc.exe is now open source; there’s surprising depth in ... by marrone12 on Thursday March 25, 2021 @06:37PM (#26586488)
My biggest complaint after switching to Windows is how poorly the start menu does math. Half the time it tells me "results are unavailable" for simple arithmetic... I don't know if it makes a web query or something to calculate but it's frustrating.
Re:Calc.exe is now open source; there’s surprising depth in ... by stjohnswarts on Thursday March 25, 2021 @05:32PM (#26585679)
Alfred also computes it to 0
Re:Calc.exe is now open source; there’s surprising depth in ... by Jtsummers on Thursday March 25, 2021 @10:25AM (#26580676)
Another comment suggested they switched from floating point to rational number representations after that version. Since 2.11 and 2.1 can't be represented exactly in floating point, it's possible that the issue was the difference was too small (smaller than just .01) and was being rounded off (or was below the limit for number of digits to display).
Re:Calc.exe is now open source; there’s surprising depth in ... by jstimpfle on Thursday March 25, 2021 @10:55AM (#26581029)
Try 2.11 - 2.1 here: http://weitz.de/ieee/ . I don't think they used 32-bit floating point, otherwise there should clearly be a large enough number to display.
Re:Calc.exe is now open source; there’s surprising depth in ... by h2odragon on Thursday March 25, 2021 @03:25PM (#26584337)
in that era, you might or might not have had FPU hardware; where it didn't exist or was off there were a variety of libraries with their own quirks that got used.
Re:Calc.exe is now open source; there’s surprising depth in ... by cobaltoxide on Thursday March 25, 2021 @04:56PM (#26585263)
How many lines of code is it?