- 5
Prove me wrong?
I broke math. https://code.sololearn.com/W13Hkah3Al4V/?ref=app
20 odpowiedzi
+ 19
the math seems intact to me
16 is quite different from 16.97056274847714
+ 11
As Burey said, you didn't break math, math broke you. :)
+ 6
Maybe you have proven there is a difference between an integer and a floating point.
+ 3
It's just like how you can't round π to 3.2 and then argue that physicists are wrong because if you calculate with 3.2 then the results will be totally off - π just isn't 3.2.
12√2 ≈ 16.97, but 12√2 ≠ 16.97.
+ 2
The sqrt of 289 is 17 exactly.
But,
The sqrt of 288 is not exactly 16.97
The sqrt of 288 is *not* exactly 16.97
Why would you think that it is?
Math and javascript seem to be working just fine.
+ 1
Should be this for correct answer:
var xc=Math.sqrt(256);
+ 1
You have proven nothing and your updated code does not explain easier. From the JavaScript course (rounding has nothing to do with it):
"JavaScript numbers are always stored as double precision floating point numbers."
+ 1
When you round 16.97... to 17 you feel it is necessary, but round 287.999998 to 288 is more unnecessary for you??? But you're a genius, of course... If we have infinite memory cell and "ask" infinite processor what equal sqrt(288), whatever we get the number, not equal to 17, because square root of non-square number is irrational (infinite) number. I.e. we exactly doesn't know what mean sqrt(2), because this number INFINITE and we never see sqrt(2) last digit, but we exactly know that sqrt(2)^2 = 2. We invented square root themselves and sometimes we shouldn't round so hard
0
You haven't tested that the variables are equal, you have tested them against 2 independent values. You are not a genious.
0
if you don't round..
287.999998 does not equal 288.
- 1
updated code to explain easier.
- 1
mathematical definition of rounding is round when you feel is necessary,. 16 rounded to 17 means,17 squared is 289.
- 1
I showed how different variables are achieved by mathematics.
✓288=16.97
but
16.97 squared does not equal 288.
if you round, then you could say round to 17.
17 squared is 289, not 288.
mathematical definition of rounding is round when you feel is necessary.
if I round at ✓288=16.97 by rounding to 17, then 17 squared is 289.
- 1
according to the mathematical definition of rounding I can round when I feel it is necessary.
✓288=16.97, even if you wanted to be accurate and not round.. the number would not be the same if you did 16.97*16.97. you can plug in the numbers, it still doesn't add up.
I was checking my work in Pythagorean Theorem when I noticed these issues.
wether you round or don't round, I'm still right.
- 1
✓288= 16.9705627
16.9705627*16.9705627=287.999998
- 1
simply put.. 16.97 was me rounding to save people the trouble of thinking too much.
- 2
16.97 squared doesn't equal 288, hence the square root of 288 does not equal 16.
- 2
if you don't use rounding, the code proves the variables are not equal.
anomaly.
I'm a genius, thank you.
- 2
Genius.
- 4
I'm a genius!