News for hackers. Stuff that matters.
Re:Windows Calculator invalid input with 10^x function by MrEldritch on Thursday August 02, 2018 @04:13PM (#17675067)
https://imgur.com/a/ukSUOhM

Holy crap. How on Earth did they manage to break Windows Calculator, of all things?

Re:Windows Calculator invalid input with 10^x function by stan_rogers on Thursday August 02, 2018 @04:32PM (#17675211)
By writing a whole new one without considering the 20%. It's also missing a lot of features compared to the old one. (Features that may not matter to everyone, granted, but I found that there were more things that weren't there for my typical uses than ones that were.) Installing the old calculator[1] isn't much of a problem, though - although you do need to pin it to make it easily accessible without finding yourself opening the new uselessness accidentally about 50% of the time.

[1] https://winaero.com/download.php?view.1795

Re:Windows Calculator invalid input with 10^x function by userbinator on Thursday August 02, 2018 @08:22PM (#17676525)
They wrote a new calculator for Win10, but AFAIK this breakage wasn't because they actually rewrote it again (as evidenced by the fact that it hasn't changed in any other obvious ways), but because of some subtle and as-yet-unknown change --- exactly the type of thing that horrifies me about silent automatic updates. What used to work is now subtly broken, and no one knows why.

Googling around, I found another discussion on it:

https://www.eevblog.com/forum/chat/windows-10-calculator-bug...

Re:Windows Calculator invalid input with 10^x function by dataflow on Thursday August 02, 2018 @05:03PM (#17675443)
If you're going to add something, add something better than the old Calc, unless you really need some feature that only exists on that Calc. I use their PowerCalc Powertoy for Windows XP. [1] There's also SpeedCrunch which in some ways is probably better (minus the plotting) but personally I'm used to PowerCalc.

[1] https://imgur.com/gi0jmdI

Re:Windows Calculator invalid input with 10^x function by userbinator on Thursday August 02, 2018 @08:04PM (#17676434)
I prefer Microsoft Calculator Plus:

http://web.archive.org/web/20111213184700/http://download.mi...

(No, not the new abomination of the same name that comes up when you search for "Calculator Plus", but the original XP-era one that is now only available from archive.org. Irritatingly enough, MS removed the old --- and better --- one when they introduced the new one.)

The one from 7 up to 8.1 has its own problems:

https://news.ycombinator.com/item?id=10791667

Re:Windows Calculator invalid input with 10^x function by mehrdadn on Thursday August 02, 2018 @08:20PM (#17676515)
Confused, isn't that just the built-in Calculator with an optional (extremely ugly) skin enabled by default? What do you like about it?
Re:Windows Calculator invalid input with 10^x function by userbinator on Thursday August 02, 2018 @08:26PM (#17676538)
It's easier to get than finding an XP installation or ISO to extract a calc.exe from. The installer is also signed by MS, which may be a factor in some highly locked-down corporate environments.
Re:Windows Calculator invalid input with 10^x function by pavelbr on Thursday August 02, 2018 @05:13PM (#17675527)
I launch apl in my terminal if the calculation I need to do is simple and Wolfram|Alpha otherwise
Re:Windows Calculator invalid input with 10^x function by mehrdadn on Thursday August 02, 2018 @05:25PM (#17675611)
APL as in... the programming language? Or something else? I'm not sure what you're referring to.
Re:Windows Calculator invalid input with 10^x function by larkeith on Thursday August 02, 2018 @07:41PM (#17676352)
It wouldn't surprise me - I'll often do the same with Python on non-Windows systems rather than bothering with the native calculator; I'm not even sure if Linux has one (or if it's the same across distros), and Python is ubiquitous, fast, and has familiar syntax.
Re:Windows Calculator invalid input with 10^x function by deadbunny on Friday August 03, 2018 @08:36AM (#17679308)
Same here, I don't have an actual calculator program so python is generally the quickest way for me.
Re:Windows Calculator invalid input with 10^x function by jacobolus on Thursday August 02, 2018 @08:20PM (#17676516)
Presumably APL the programming language.

Personally I used to use Maple for this kind of thing circa 2002. It used to launch on Windows in a fraction of a second (faster than the built in calculator tool!), and was an amazing calculator for pretty much any purpose.

Unfortunately some version of Maple around that time switched to a Java-based front end, and thereafter took forever to load, and had a UI littered with glitches.

Re:Windows Calculator invalid input with 10^x function by cnasc on Thursday August 02, 2018 @08:12PM (#17676477)
I've used J (a language in the APL lineage) as an interactive calculator before. It makes some things pretty easy, especially if you need to operate on series of numbers.

What's the sum of the numbers from 15 to 20 inclusive?

  i.6 N.B. Returns an array 0 1 2 3 4 5

  15 + i.6 N.B. Returns an array 15 16 17 18 19 20

  +/ 15 + i.6 N.B. returns the number 105
edit: Or course, if we're talking about languages helpful for calculation, we simply must include a reference to https://frinklang.org/
Re:Windows Calculator invalid input with 10^x function by na85 on Friday August 03, 2018 @08:40AM (#17679326)
I just use an actual calculator.
Re:Windows Calculator invalid input with 10^x function by rwmj on Thursday August 02, 2018 @05:08PM (#17675479)
They're learning from GNOME! (GNOME whatever the latest version includes a new calculator that is an awful step backwards compared to the old one, luckily I can still install the old one).
Re:Windows Calculator invalid input with 10^x function by chris_wot on Thursday August 02, 2018 @05:22PM (#17675592)
The old Gnome calculator was incredibly buggy for years (this is going back a fair while, of course).
Re:Windows Calculator invalid input with 10^x function by gsich on Friday August 03, 2018 @04:44AM (#17678224)
I don't think the new one is any better.
Re:Windows Calculator invalid input with 10^x function by deadbunny on Friday August 03, 2018 @08:42AM (#17679333)
The GNOME devs MO is 80% development, hardly surprising.
Re:Windows Calculator invalid input with 10^x function by badsectoracula on Friday August 03, 2018 @05:47AM (#17678493)
And it is slower, really noticeably slower in terms of startup time than the old calc.exe in windows 7 and before. Not to mention it covers 50% of the screen for no reason.
Re:Windows Calculator invalid input with 10^x function by contextfree on Thursday August 02, 2018 @08:01PM (#17676420)
They didn't write a whole new calculator engine, just a new UI and app wrapper for the old one.
Re:Windows Calculator invalid input with 10^x function by sbjs on Thursday August 02, 2018 @08:08PM (#17676453)
If the new one just wraps the old one, but the new one breaks on certain inputs, how is it breaking? Maybe the outer "new" layer uses a new string to number parser than the inner "old" layer used to use, and that's where the bugs are being introduced?
Re:Windows Calculator invalid input with 10^x function by contextfree on Thursday August 02, 2018 @08:12PM (#17676478)
They continued to update the underlying engine with new features and bug fixes and new bugs, they just didn't rewrite it from scratch.

Apparently a recent update also fixed a longstanding problem where the square root of a perfect square integer doesn't give you the exact right answer, so maybe there was a general change to the implementation of exponents and roots which may have introduced this bug too.

Re:Windows Calculator invalid input with 10^x function by amenghra on Thursday August 02, 2018 @05:16PM (#17675555)
I have found (and reported) at least two similar bugs in Mac OS X's calculator. It's not just a Microsoft thing :)

In both instances, Apple didn't respond to the bug report until many years later, when they just closed it.

Re:Windows Calculator invalid input with 10^x function by zamadatix on Thursday August 02, 2018 @04:38PM (#17675257)
If I had to take a first guess since 1e10000 is an overflow in the current version therefore x = 1e9999 is the last valid 10^x input. If that holds true my guess would be someone added a check for that input but did it as "5 or more digits" rather than "10,000 or more".

My second guess is they are using some weird algorithm that hits an error case due to the limits of whatever number type they are using.

Re:Windows Calculator invalid input with 10^x function by rspeer on Thursday August 02, 2018 @06:36PM (#17676049)
I wonder if they're using a fraction type to store decimals (a reasonable way to avoid floating-point error), and when the 10^x function is implemented naively on this type, 10^(3.1415) becomes 10^(31415/10000) = (10^31415 / 10^10000) = (overflow / overflow).
Re:Windows Calculator invalid input with 10^x function by istjohn on Thursday August 02, 2018 @09:34PM (#17676733)
> 10^(31415/10000) = (10^31415 / 10^10000)

If n^(a/b) = (n^a)/(n^b) then 2^(1/2) = (2^1)/(2^2) = 2/4 = 0.5 but 2^(1/2) = sqrt(2) = 1.4...

Re:Windows Calculator invalid input with 10^x function by rspeer on Friday August 03, 2018 @02:35AM (#17677691)
Dang, you're right, I should have known that. I apologize for my bad math.

It would be the 10000th root of 10^31415, and at this point what I'm saying is probably entirely unrelated to how it's really implemented.

Re:Windows Calculator invalid input with 10^x function by akerro on Friday August 03, 2018 @08:15AM (#17679197)
In a few years Windows will be just a red button that makes farting sound when pressed.

EDIT: and telemetry.

Re:Windows Calculator invalid input with 10^x function by gnopgnip on Thursday August 02, 2018 @04:53PM (#17675384)
Until last month doing sqrt of 4 or other perfect squares would give small errors
Re:Windows Calculator invalid input with 10^x function by archvile on Friday August 03, 2018 @07:57AM (#17679094)
What’s even more bizarre is how often they update the Win10 calculator app from the Windows store. Never had any idea that a calculator would need bi-weekly updates, but shrug
Re:Windows Calculator invalid input with 10^x function by mehrdadn on Thursday August 02, 2018 @04:57PM (#17675413)
Wait, what? It works fine for me. https://imgur.com/a/LvZtIOd
Re:Windows Calculator invalid input with 10^x function by xeromal on Thursday August 02, 2018 @05:48PM (#17675745)
Your windows might be out of date. It fails for me too.
Re:Windows Calculator invalid input with 10^x function by mehrdadn on Thursday August 02, 2018 @05:52PM (#17675773)
I don't think so. See this thread: https://news.ycombinator.com/item?id=17675426 I'm on 10.0.17134.191 whereas it fails for people on both 10.0.17134.191 and 10.0.17134.167.
Re:Windows Calculator invalid input with 10^x function by contextfree on Thursday August 02, 2018 @08:33PM (#17676560)
I think apps update separately from the OS

It may have been the same update that made this change https://blogs.msdn.microsoft.com/oldnewthing/20180704-00/?p=...

Re:Windows Calculator invalid input with 10^x function by cup-of-tea on Thursday August 02, 2018 @05:22PM (#17675596)
Who cares? It looks all flat and fashionable which is what you really care about.