- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Not really convinced that System.Runtime.InteropServices.SEHException (which is what you'd get from a c0000005 access violation) could plausibly get mangled in that way.
Admin
Weight is a force, you are probably thinking about mass
Admin
As someone who has never heard anything about pi and the bible before, I googled and found an interesting take on that. This link indicates that pi actually was being approximated to 3.14, when you considered the units involved.
http://www.purplemath.com/modules/bibleval.htm
Admin
Spot on in your example on the 10 commandments - how do you think religions justify the violence in their history?
It is intereating that you take a statement about the bible not being a literal description of fact and interpret that to mean that any concept expressed within must be a metaphor.
Finally, I think your rant goes a good way to emphasising the OP's point. It seems many Christians (and people of other faith's) accept that Science can coexist with their beliefs, while people on the pro-Science (or rather anti-religion) page seem to take it personally when anyone suggests that they can coexist.
If religion is a whole load of crap (which it may well be) why do you care enough to get upset about it? I can understand religious zealots getting upset when people suggest their religion is wrong but I can't understand why the non-religious people care that there are those in the world who choose to follow a religion. And yet, like the OP I think I commonly see (as above) that scientists irrationally get upset at the thought that someone still believes in religion (something that in no way affects them or the validity of scientific proof)...
It's weird. You'd expect the religious fanatic to be the agressor (because their beliefs are challenged/threatened by science), and the scientis to be dismissive (because it's just some loonies believing odd things). Yet somehow it often appears the opposite. Strange indeed.
Admin
Typing an underscore can be a pain. I personally love this wrapper method.
Admin
Admin
Because it's the standard method of rounding in experimental science? If you divide 25 by 2.0, you get 12, if you divide 23 by 2.0, you also get 12. If you average 12 and 12 you get 12. If you divide the average of 23 and 25 by 2.0, you get 12. See the consistency?
Now try rounding up- the average of 25/2.0 and 23/2.0 becomes 13 (remember significant figures), while the average of 25 and 23, divided by 2.0, is 12.
Admin
You don't use floats in financial applications (or you should be hanged, quartered and then fired afterwards). When rounding 123.50 to whole number, or 123.005 to whole cent, there are specific rules (in law) specifying when to round up and when to round down. Adding 0.5000001 would, naturally, break everything.
Admin
It seems many Sientists accept that Religion can coexist with their views of the world, while people on the pro-Religion (or rather anti-science) page seem to take it personally when anyone suggests that they can coexist. If science is a whole load of crap why do you care enough to get upset about it? I can understand scientific zealots getting upset when people suggest their science is wrong but I can't understand why the non-science people care that there are those in the world who choose to follow science. And yet, I think I commonly see that religous people irrationally get upset at the thought that someone don't believe in religion (something that in no way affects them or the validity of their faith)...
It's weird. You'd expect the scientists to be the agressor (because their view of the world is challenged/threatened by religion), and the religious people to be dismissive (because it's just some loonies believing odd things). Yet somehow it often appears the opposite. Strange indeed.
Admin
Mick, while I try to avoid the tendancy to rant... it's not that weird that scientists defend themselves aggressively. It's cause and effect.
Why do I care that there are people in the world who choose to follow a religion? Becuase some of those people have an almost total lock on important public policy decisions, and they keep using it to make stupid decisions as a result.
I have no choice but to care.
After fifty years of science there are still people denying that global warming exists, and recently - for the first time - churches are major motivators in that. After a century and a half of science people (and I mostly mean 'USA-based evangelicals') are still denying evolution, and churches are the only motivators in that.
We scientists are becoming aggressive because we're frustrated by being under non-stop church-driven long-range attack. There's no point being surprised that people who keep being shelled react badly to the sound of gunfire. (Unhelpful, sure. But very human.)
Dawkins is an overly-aggressive idiot who harms his cause every other time he opens his mouth. But it's easy to see how he got that way.
(Captcha: erat. He was a much calmer man, back when he could study biology biology without incurring a five-minute-hate campaign from half the US.)
Admin
(154)
Admin
Admin
PI cant still be calculated in some languages like VBA But you can use the math formular 4 * ATN(1) (arc tangent)
Admin
Perhaps you are just trolling, but the idea that using "round to odd" is always better than "round up" is a bit wrong and contains some hidden assumptions about data distribution.
For I agree that if all your data are exactly half way between two integers, then you'll get better total sum if you decide to round at least some of them down instead of rounding up. And this is what happens if some of the numbers have odd and some have even integer parts. But this just seems to me as a "pseudo-random algorithm", which fails if all values have same integer part.
Furthermore, if your data points are of form x+0.50001 or x+0.499999, or anything else which isn't always a multiple of 0.5 then there is no difference between the two methods. And if for some reason you know all your data is a multiple of 0.5, then why don't you just multiply everything by 2, and use integers?
OK, I lost my point, but it was something like "you know, if you need a way to deal with those pesky x+0.5 values in your data set, then just count their number (n) and add n/2 to your result and don't rely on pseudorandomness".
Admin
"But pi is a constant that will never be 3."
Pi is a constant that will never be ANY written representation. Rounding must occur somewhere. The place where where pi is calculated in the Bible wasn't concerned with precision.
Admin
Actually Noah needed a good number of them.
Admin
One possible problem is that the value of "Maybe" is computed at compile time, so the value that Maybe represents will be the same across all runs of the program (at least until the next time it is recompiled).
Dunno if that's a bug or a feature.
Admin
In financial applications, if you are caught using floating point for monetary values you will be lucky if they just fire you and don't take you out back and shoot you.
Admin
There is ALWAYS a FileNotFound option in addition to all other options, even when it doesn't logically make any sense. That is the WHOLE POINT of a FileNotFound option!
Heretic.
Admin
You missed a spot. Near the end (of what you gave) it is ...494459..., not ...49449....
Admin
Not always. There are plenty of financial calculations where floats are fine. Generally, they are dealing with things like estimated future profits, volatilities, etc.
Not all of finance is about keeping track of money in accounts.
Admin
Typo. Not used to using the numpad but it was the quickest way. Why don't you give it a try?
Fixed: 3.1415926535897932384626433832795028841971693993751058209749445923078
Admin
[qoute]"There are many ways to convert a number to a negative," writes Rafael L, "this, I suppose, is one of them."
// Convert to negative number varInt := StrToInt('-' + IntToStr(varInt)); [/quote]
This isn't nearly as bad as I once did in one of my first programs in my first position as a programmer. Minoring in Math, I stupidly coded this to make the number negative.
This may make more since to those of you familiar with RPGIV fix format code.
basically it's the same as coding this.
My boss came to me and said, why not just multiple by negative one. I just slapped myself in the head and changed the code.
At my new place of employment. RPGIII code is still rampant. I've seen this code to make the value negative.
which is the same as saying
Admin
Admin
Can you evoke methods on a null reference without taking a NullPointerException due to the reference being null? (I'm admittedly not a Java expert.)
Can you give a snippet of code that would invoke this method on a null reference?
Admin
There's no comma-pause when the REAL Nagesh mispromunchinates.
Admin
And then there's the inscrutable C/C++ branchless approach:
Admin
I'd say the answer is a definite maybe.
Admin
Admin
The rounding routine isn't horrible as the default Math.Round rounds to even on midpoints which will bite you sometimes. However, I believe a simple overload will do everything that routine does: Math.Round(decimal, intDecimalPlaces, MidpointRounding.AwayFromZero)
Admin
Double as well.
Math.Round(double, intDecimalPlaces, MidpointRounding.AwayFromZero)
Admin
It shows that they didn't understand that didn't understand that pi exists at all; if you're working to one significant digit, there's absolutely no reason to give the diameter and circumference of a circular object.
Admin
Null is void, and void is not an object. where is your object's gawd now?
Admin
Assetion fail: current_universe.getGeometry returned space_time_continuum class.
Admin
This is because religious people spread a lot of lies or wrong knowledge that don't take humanity forward. Misconceptions and wrong knowledge must be eradicated. I see quite opposite, a lot of scientists coexists his religious faith with science, but majority dismiss it. Is the religious people that are upset because they can't accept that someone has an divergent opinion. But fanatics exists on both sides, i see much more fanatics on religion than on science. Scientists denials much of religion as a myth or fairy tales, they aren't upset, they are just denying, it is their personal opinion, not science opinion. You can pretty much believe or not believe in anything. Some religious people that are upset because of this, because they can't grasp that someone don’t believe what they believe. Yes, they are wrong in thinking that way.
Admin
Admin
half-to-even is the most commonly used "unbiased" rounding conventions. I hope it's also the rounding method you learned in your Junior High science classes.
I'm not sure what the split is in elementary schools teaching half-towards-+Infinity vs. half-away-from-zero. In any case, you'll find that even within the U.S., different schools teach different rules for rounding negative numbers.
This also happens to be the default rounding mode for IEEE 754 floating point calculations. (It's also the recommended default for IEEE 754-2008 decimal floating point calculations.)
If you don't know enough to know what kind of rounding you want, scientific rounding is probably the safest default. If you wanted half-away-from-zero, you'll probably figure it out fast enough. However, if you're doing scientific calculations (or porting scientific code from another language) and you use a biased rounding convention, the bugs will be much more subtle. Given a choice between surprising ignorant people but doing what's likely the safe thing (unbiased rounding, bankers' rounding, correct for scientific/engineering calculations) vs. doing something that quickly surprises ignorant programmers and prompts them to educate themselves.... well, I think the IEEE 754 committee made a good choice.
Rounding half-away-from-zero when an unbiased rounding is called for is more likely to cause a fatality (engineering code) or significant money loss (econometrics code) than vice-versa.
The Real WTF is criticizing rounding conventions without sitting down to understand them first.
Admin
half-to-even is the most commonly used "unbiased" rounding conventions. I hope it's also the rounding method you learned in your Junior High science classes.
I'm not sure what the split is in elementary schools teaching half-towards-+Infinity vs. half-away-from-zero. In any case, you'll find that even within the U.S., different schools teach different rules for rounding negative numbers.
This also happens to be the default rounding mode for IEEE 754 floating point calculations. (It's also the recommended default for IEEE 754-2008 decimal floating point calculations.)
If you don't know enough to know what kind of rounding you want, scientific rounding is probably the safest default. If you wanted half-away-from-zero, you'll probably figure it out fast enough. However, if you're doing scientific calculations (or porting scientific code from another language) and you use a biased rounding convention, the bugs will be much more subtle. Given a choice between surprising ignorant people but doing what's likely the safe thing (unbiased rounding, bankers' rounding, correct for scientific/engineering calculations) vs. doing something that quickly surprises ignorant programmers and prompts them to educate themselves.... well, I think the IEEE 754 committee made a good choice.
Rounding half-away-from-zero when an unbiased rounding is called for is more likely to cause a fatality (engineering code) or significant money loss (econometrics code) than vice-versa.
The Real WTF is criticizing rounding conventions without sitting down to understand them first.
Admin
All of you are getting so upset, you're forgetting that a cubit was not exact to begin with.
It's like saying "a shot" as a liquid measurement today, and getting angry over an interpretation of how much wine Jesus actually made from water.
Admin
Admin
Um, no.
Weight is a type of force, measured in newtons (or pounds, etc.). Mass is a measure of amount of matter, NOT A force, and is measured in kilograms (or whatever the Imperial unit of mass is - I used to know this). Since weight is a force, units of force are the only correct way to answer that question as it's worded.
Admin
This makes no sense. We're talking about a ParseInt function, not eval(), so syntax of the host language could never apply. Even in C++ one would expect itoa() or equivalents to fail on a double negative.
Captcha: genitus (the ringing in your ears from the Big Bang)
Admin
The fact that Pi began life as the ratio between a circle's circumference and its diameter has no bearing on the fact that it has since become a fixed mathematical constant with implications far beyond its original meaning. To name one example: complex numbers/mathematics/analysis relies on Euler's relation, which incorporates a fixed constant known as Pi. Another example: solution of differential equations often requires e.g. the Fourier transform, which also relies on Pi and complex numbers.
The ways in which Pi is used in these two areas have nothing to do with physical geometry, and if you try to use a different value for Pi, the maths BREAKS, period.
This gets more confusing when one considers quantum mechanics, i.e. a physical theory where geometry is relevant. While one might try to solve QM in a non-Euclidian spatial geometry where the physical value of Pi is different, you still can't alter the mathematical constant Pi on which the complex mathematics describing the evolution of the wavefunction rests; if you do, the maths will break and your results will be garbage.
Summary: using "Pi" to name the ratio of circumference to diameter of a circle in non-Euclidian spatial geometries is incorrect unless prefixed (e.g. "physical", "local") to make clear that it's being used as a shorthand for a curvature metric. Used unqualified, it refers to a fixed mathematical constant that will never change because its meaning has, for centuries, transcended physical geometry.
Admin
Admin
http://msdn.microsoft.com/en-us/library/ms131275.aspx
What exactly is this function lacking?
Admin
The real WTF is in the comments.
Do people really think that writing -1*x is better than -x? Are there popular languages where that doesn't work? Are there popular languages where that doesn't compile to a simple integer negation operation, which will be as fast as or faster than multiplication (or subtraction as in 0 - x) in all cases? Of course, if you want to force the sign to negative, -abs(x) should be just great.
Admin
Informative Article. I am very glad to read this excellent post