Jump to content

stupid thing thats bothering me

Featured Replies

Open the Windows Calculator.

 

enter 2 and press 'sqrt' to get the square root of 2

press '×' and then '=' to square the square root of 2 to get 2 again

subtract 2

 

wha???

I have a Macintosh and the calculator program obviously doesn't have the same bug as does the Windows brand. If you are getting a number like +-0.00000000000001 or something, it may be because of infinitesimal errors that propagate offscreen and then get displayed at the end. This can be observed in programming if one multiplies/divides huge numbers or incredibly small numbers.

  • Author

when i subtract 2 from 2 at the end i get:

 

1.1578739678741186722221088213213e-37

 

which doesnt make sense, 2-2=0 so it must be a bug

Yeah, it's some tiny, tiny number. It's just a bug. You shouldn't be so bothered by it.

That number is so close to zero it can be rounded for practical purposes to zero. Who knows why it doesn't just make it zero.

Yeah, I get 4.231503478368152916468244968377e-38

 

computers have trouble rounding when it comes to that degree of precision. It has to do with the fact that the registers that store the numbers are finite in size.

  • 1 month later...

Yeah, but what's weird is that the error isn't in the calculation 2-2=0, the error is in displaying 2 as the result of sqrt(2)^2, which is where the bug occurs. If it calced the result as 1.999999999999... why didn't it display that?

because it rounded the number to fit into the display even though the 1.9999999... is still stored in the memory as that.

On my Mac Calculator, I got 0.82842712475

I wouldn't call that a bug. It is correct to 37 significant figures! I think you are being a bit perfectionist if you want it better than that.

On my Mac Calculator, I got 0.82842712475

 

yes, a mac. there is your problem right there.

  • 2 weeks later...

Good ol' GNOME Calc gives me a -0. Looks like Linux wins again.

9.6489497322843222685175735110111e-38

 

38 sig figs for me. damn you linux...

 

DAMN YOU...!

 

lol

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.