- 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
Damn you Metric System! Damn you to hell!
Admin
First! [pi]
Admin
It's obvious: first convert pounds to kilograms (0.453592 kg/lb), then convert from kilograms to tons. (907.1847 kilograms in a ton).
WTF?!
Admin
Maybe this was done by somebody who only understood metric and was saying to themselves "wtf is a pound?". .4535924 kg = 1lb and 907.1847 kg = 1 ton.
Admin
The real WTF here is that Americans still don't use the metric system.
Admin
Actually, the math is pretty close. The numbers are clearly for a metric ton, ~2204 lbs = 1 metric ton. Using his math, 2204 lbs = 1.102 tons. I'm willing to give the benefit of the doubt that he (a) got a rather imprecise conversion factor (I beleive the actual conversion factor is an irrational number), and (b) rounded poorly.
--Mike
Admin
Something leads me to belive that this function was never intended for doing an actual conversion. Why would one need anything beyond an inline function to do such a trivial conversion? What I am thinking, is that the return value of this function was intended to be used as a modifier. Perhapse for a metric conversion?
What intrigues me is the little "m"'s at the ends of the numbers. Unless this is a code construct I am not familiar with, I'd love to see what role it plays.
Admin
What this is doing is converting to kilogrammes, and then from kilos to short (US) tons. It's an approach which would make sense for PoundsToTonnes, but not to either of the other tons.
My guess is that this was automatically generated by something that only had conversion factors to and from SI units and wasn't very clever.
Admin
all I can say is [|-)]
Admin
He should've converted to dollars first.
Admin
please tell me no one needed the link to the answer....
Admin
Or, just maybe, he was converting into a standard ton. By definition 2000 lbs = 1 ton. Using his math, 1999.9997795 lbs = 1 ton. That is a heck of a lot closer than the 10% error to your theory.
Admin
No, the real WTF is that the rest of the world has been duped into using that inferior system.
Admin
Because a system based on density of water is pure madness.
Admin
There are a variety of units known as a "ton". There's the short ton of 2000lb (used in the USA, and called simply "ton" there,) the long ton of 2240lb (used in the UK, and known simply as a "ton" here,) and the tonne of 1000kg (metric, ~2204lb.)
There are also a few other units called "ton", see http://en.wikipedia.org/wiki/Ton
Admin
This all reminds me of a program I was reading that converted seconds to "shakes of a lamb's tail" to do animation.
Apparently, the standard shake of a lambs tail is 1/10th of a second.
Admin
I was confused by those m's as well. They have to be a language feature. What language is this code in? C# maybe? Looks kinda like Java but Java doesn't have a "decimal" type.
Maybe someone could enlighten us about these m's ??
Sincerely,
Neil Armstrong
Admin
More exactly is:
"The real WTF here is that people from <font size="5">USA</font> still don't use the metric system."
the rest of the americans(yeah the american continent start in alaska and end in the patagonia): mexicans, cubans, peruvian, chilenian, etc use it !
Admin
Yes. There is the correct unit, and the evil imposters.
Admin
They don't count.
Admin
So sad. Every year thousands of USA-nian children are forced to learn an obsolete system of measurement, which isolates them from the rest of the civilized world, all so that Detroit doesn't have to retool its factories.
Admin
There are some VMS tools that accept fortnights as interval units.
Admin
You haul 16.0000017637 tons, and whaddayaget
(yes, I did compute it based on those factors)
Admin
the 'm' is for metric. as in, "have you met rick? he's the moron who coded this shit."
Admin
The "m"s are just to declare the literals as decimals, as opposed to integers or doubles. (sort of like "f" for float, "ul" for unsigned long, etc.. in C/C++)
Admin
just drop the last 7 from the tonFactor (907.184 instead of 907.1847) - then the conversion works perfectly for non-metric tons. w00t.
Admin
Here you have it folks, today's WTF.
Admin
<FONT style="BACKGROUND-COLOR: #fffbf0">USA *is* the civilized world.</FONT>
Admin
And which one is the correct unit is left as a cause of flame wars an exercise to the reader. ;)
Admin
Hrm, I think I would rather keep using the numbers like 5280, 1.54, (9/5)+32, 12, 3, 2000, 220<font size="3">0, </font><font style="font-family: times new roman;" size="3">3.785 </font><font size="3">etc</font>, than by factors of 10. See - the metric system just doesn't make sense to me. It sounds WAY too complicated, give me the standard system any day.
.jc
Admin
Huh? Last time I looked by socket set has metric and 'standard'. That's not the reason. Even if it were, Detroit won't have any factories soon.
The problem is that old people don't want to have to learn a new system.
Also, not all tons are equal. Some tons are heavier than others.
Admin
I did. There are 1000 kilograms in a real ton.;)
Admin
from vs online help:
Literals
If you want a numeric real literal to be treated as decimal, use the suffix m or M, for example:
decimal myMoney = 300.5m;
Without the suffix m, the number is treated as a double, thus generating a compiler error.
Admin
I dunno, as WTFs go, the real question is why a country that has no use for the regency continues to use an ambigious, arbitrary measurement system that is BASED on the regency's body (and varied from regency to regency).
It is almost as if they MISSED having royalty. Tell ya what! We've had plenty of that up here in Canada, and we can afford to be generous. You can have our Queen in our place. Heck, we'll even throw in the governer general who THINKS she's the queen (of what, we are not quite sure, since she's clearly an anti-queen seperatist who comes from a cuture that KILLED all their regents in the past few hundered years, no matter what the liberals were forced to lie about after they got caught blindsided by the whole affair).
In fact, you can even have Adrien Clarkson... Her delusions that she's the queen from her time as the governer general are so strong that they probably still persist.
Geeze, that's some threat! Go metric or we'll send in the queen!
Admin
> and disabled rounding for debugging purposes.
WTF?
Explain. Both 'how?' and, well, 'why?'
Admin
lol... older w/ more debt!
Admin
The metric system was created by the French revolutionary government while they executed tens of thousands. The metric system was used by the Nazis during the holocaust, the Bolshevicks during their purges, and the Chinese during the Culteral Revolution.
Is this a coincidence? The metric system demands absolute conformity from its weights and measures. Measures that do not conform are ruthlessly eliminated. These authoritarian regimes demand absolute conformity from the people under their yolk, ruthlessly eliminating any who would not conform.
I, for one, am glad to live in a land where fractions of inches are measured in sixteenths, 12 inches make up a foot, and 3 feet make a yard. Give me furlongs and acre-feet. Give me rods and chains. Give me ounces, both dry and fluid. But give me liberty. When my units are free I can be free.
And those in that again dark continent... I'll keep a candle lit for you that you will eventually throw of the yoke of your new masters in Brussells. Today you conform in currency. You are growing in legal conformity. Soon they will come to make you conform in all ways, at risk of your very life.
Admin
Hey, Leo. Glad you could join us from the Peoples' Republic of Canuckistan. :)
Admin
The ms are for decimal literals.
Admin
Ok, everyone can use anything they like, even if it makes you crash satellites, but why would they call it standard? there is nothing standard in it. Are they trying to mock it?
Admin
I come for the wisdom, I stay for the trivia, and I won't leave for a buck.
Admin
>> Today you conform in currency.
ROFLOL!!
Go ahead and check $ / € exchange rates and see tendency for yourself...
LP,
Dejan
Admin
I did. Similar to how I would need to look up what a cubit or stadia was.
Admin
well i am a citizen, born and raised in the US of A and I proudly use metric system, soley. If I am asked my weight, Ill give it in kg, i am asked the outside temp, ill say it in C. US changed into metric long ago, legally speaking. I am just using it and not my fault americans are too lazy to use a superior measurment system bc to them its tradition. no wonder why the rest of the world hates us.
Admin
Factories? In the USA? Don't be silly, they've outsourced all that stuff to China. All they make in the USA these days are brand names and hype.
Admin
Now compare unemployment rates, growth rates, etc. Please tell me why I shouldn't be laughing.
Admin
LOL. Tell me about it. I always have to stop and think, now how many inches are in a foot? And how many ounces in a pound again? I love the metric system. Just multiply or divide by 10 to move up or down the scale. ;)
The real problem is that 90% of our stuff is still mass-produced in the old English system. It would cost so much to convert everything over that there would be no real value gained. ^o) We should have made the switch 100 years ago when it wouldn't have cost so much.
Admin
Fascist!! Why Don't You Move to Canada!!
Admin
I was part of the first set of students that were taught the metric system because the Canadian government decided to drop the Imperial System, the system created and forced upon by the British Monarchy, the same Monarchy that you Americans fought to achieve freedom from. Hmmm, yet you continue to use the antiquated system they forced upon most the the world they ruled, yet most of those countries upon leaving the commonwealth chose to move to the Metric system. So who is it that choses freedom? I think if you leave aside your patriotic rhetoric you would actually see the significance of using the Metric system.
Admin
I believe the term for wrenches, sockets, etc. is SAE. At least I'm 14mm sure. Now there is an interesting question - what IS our system called?
On the subject of software design: I wonder what his function for conversion from feet to miles looks like... And if the programmer would have taken a nautical mile or a statute mile...