|
greldak wrote: In this case airspace was closed to commercial flights below 32000 foot and this was flying at 33000 which was believed to safe from the use of portable anti airraft weapons. Long range SAMs were not considered likely probably naively.
I suspect following this airlines will avoid the area totally.
One can hope.
Once you lose your pride the rest is easy.
I would agree with you but then we both would be wrong.
The report of my death was an exaggeration - Mark Twain
Simply Elegant Designs JimmyRopes Designs
I'm on-line therefore I am.
JimmyRopes
|
|
|
|
|
3D Homunculus Nebula [^]
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
Those who seek perfection will only find imperfection
nils illegitimus carborundum
me, me, me
me, in pictures
|
|
|
|
|
Wow, I think looks kinda like a shelled peanut, maybe a day with less caffeine is needed to make sense!
|
|
|
|
|
Four web browsers(opera, safari, firefox, chrome) reports the answer to the following calculation *incorrectly*:
((54/31)+140)
Those 4 browsers return the value : 141.74193548387098
IE reports the value of : 141.74193548387097
Note:The two leading #s in the next example are just for alignment.
if you calculate 54/31 using javascript and browser you get:
##1.7419354838709677
The second one calcs the same equation and simply adds 140 ((54/31)+140) -- to change precision.
141.74193548387098
Notice the digit after the last 9 in the sequence. The rounded up value should be a 7 (round up from 6), but it is reported as an 8 in every browser except IE. You can also compare the value to Windows Calculator for 54/31.
Windows calculator gives : 1.7419354838709677419354838709677
Interesting?
Here's the HTML / JavaScript so you can copy / paste and try in all browsers:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div>Clicking the [Calc] button runs two calculations and shows the result on this page. First calc is: (54/31)</div>
<span style="color:red">Note:</span><span>The two leading #s are just for alignment.</span>
<p id="p1">
</p>
<p id="p2">
</p>
<div>The second one calcs the same equation and simply adds 140 ((54/31)+140) -- to change precision.</div>
<div id="extra" style="color:blue"></div>
<input type="button" value="Calc" onclick="DoCalc()"/>
<script type="text/javascript">
var p1 = document.getElementById("p1");
var p2 = document.getElementById("p2");
var extra = document.getElementById("extra");
function DoStart()
{
testdiv.textContent = "started";
}
function DoCalc()
{
p1.textContent = "";
p1.textContent += "##" + 54/31;//calcObject1.y / calcObject2.x;
var outval = ((54/31)+140);
p2.textContent = outval.toString();
extra.textContent = "Notice the digit after the last 9 in the sequence.";
extra.textContent += " The rounded up value should be a 7 (round up from 6), but it is reported as an 8 in every browser except IE.";
extra.textContent += " You can also compare the value to Windows Calculator for 54/31. Interesting?";
}
</script>
</body>
</html>
|
|
|
|
|
That's in the 17th SF so I think it's just hitting double precision. I get the same (apparently) wrong answer using double precision arithmetic in .Net too. If I use arbitrarily extended precision I get
141.74193548387096774193548387096774193548387096774193548387096774...
... which seems right as it's a repeating fraction.
I guess IE's JS engine uses some extended precision (128 bit?) floating point API behind the scenes.
|
|
|
|
|
That didn't really prove anything yet. I'll do the math though, will report back.
Ok then, the results are in. And guess what: it's IE that's wrong.
(54.0 / 31.0) + 140.0 evaluated with IEEE 754 doubles in Round to Nearest mode (as JavaScript demands, right?) gives exactly:
141.741935483870975076570175588130950927734375 (exact representation of the correct result)
141.74193548387097 (ie)
141.74193548387098 (correct conversion to 17 digits)
That 54/31 seems to give 1.7419354838709677 is really irrelevant, because
0) that's not what it gives. It gives 1.7419354838709677490982130620977841317653656005859375 (exactly).
1) a Number in JS is not a 17-digit decimal string that is manipulated like we learn in elementary school, it's a an IEEE 754 double.
modified 17-Jul-14 12:28pm.
|
|
|
|
|
That's very interesting. And as long as someone is wrong I'm happy.
Now, it just makes it all the better that IE is wrong. But that would /should mean that Windows Calculator is also wrong, because it gives same answer as IE.
|
|
|
|
|
Windows Calculator doesn't give the same answer as IE, it gives 141.74193548387096774193548387097. That would round to the string IE is displaying, but it doesn't round it so it's not the same.
Anyway, Windows Calculator doesn't make the same promise as JS. The help page says:
> In Scientific mode, Calculator is precise to 32 significant digits.
That's completely different from "IEEE doubles in Round to Nearest mode".
|
|
|
|
|
Oh, okay. You got good info. It's funny how it all seems right and the same til you start looking at this stuff up close.
Thanks for posting.
|
|
|
|
|
Since the precision significant digits for the equation has no decimals should the answer (rounded) not be 142?
At the most 141.7419 should be the answer.
[Edit]remembered correct phrase[/edit]
|
|
|
|
|
|
LOL! I found this a long time ago and had no one to share it with. You are the lucky ones.
|
|
|
|
|
That's the 14th decimal place? Close enough.
Are you trying to plot the position of a particle on the other side of the galaxy or something?
|
|
|
|
|
using this code:
decimal value = (54M / 31M) + 140M; , you get this answer (every time): 141.74193548387096774193548387
---------------------------
using this code:
double value = (54d / 31d) + 140d; , you get this answer (most of the time): 141.74193548387098
---------------------------
using this code:
double value = (54 / 31) + 140; , you get this answer (every time): 141.0
---------------------------
What's your point? All of your examples are wrong because you're using floating point math.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Mr. Dale Carnegie's first rule of Winning Friends & Influencing People is "Never tell a person they are wrong."
Also, there is no Decimal type in JavaScript and my original runs in JavaScript. Nor is there any double type.
Well, not really.
Also, did you run the JavaScript sample in IE? Then you would've gotten the udder answer.
Also, I have not point. It was just math for fun.
thx.
|
|
|
|
|
I don't really care about what types are/are not available in Javascript. The simple fact of the matter is that it's using floating point math to do it, and you're never going to be absolutley sure about what you're gonna get back for the last digit because of that fact.
And what the hell is wrong with you? Math is NOT fun. I've been doing trig in code for the last week or so, and I kinda hate it.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
John Simmons / outlaw programmer wrote: And what the hell is wrong with you? Math is NOT fun.
Agree with you there. I bet the wizards come out and bash their math clubs upon our noggin's now.
|
|
|
|
|
John Simmons / outlaw programmer wrote: Math is NOT fun.
Those are fighting words.
[Picard voice] To each his own, #1.
|
|
|
|
|
The real head-spinner for me is that all of the browsers could (and hopefully should) have calculated exactly the same value.
The 'bug' could be in the converting to decimal for displaying.
|
|
|
|
|
Right. That was really my point. Everyone (browser) should at least be on the same page on how to display the final value.
Thanks for noticing.
|
|
|
|
|
Amazing twitter grammar fails[^]
Nothing like hyping up what might bring a smile to your face but nor much more, though you do wonder at modern education. Or is everyone just stoopid?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
Those who seek perfection will only find imperfection
nils illegitimus carborundum
me, me, me
me, in pictures
|
|
|
|
|
Well, I is.
But I'm not on Twatter.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
|
My current favorite is from Tony Abbott (Prime Minister of Australia): Quote: "No one -- however smart, however well-educated, however experienced -- is the suppository of all wisdom. - Tony Abbott"
Source Link [^]
|
|
|
|
|
The BNP Youth Leader is currently being mocked in various online publications for a Facebook rant against his gay dog challenging his principles so I googled his name to find out a little more about him, one hit took me to the BNPs official online TV channel where they have footage of him delivering a speech at the age of 17. The text that accocompanies the video is;
Quote: One of many speakers at a recent demonstration in Blackpool was 17 year old Jack Renshaw who delivers a very well wrote out speech regarding society and the family unit.
Some men are born mediocre, some men achieve mediocrity, and some men have mediocrity thrust upon them.
|
|
|
|