Comment On The 2,000 Pound Question

David was modifying a report produced by one of his company's applications and disabled rounding for debugging purposes. He thought it was a bit strange that the Tons field overflowed with itsy-bitsy fractions (such as 22.500002480200558937997962267231), especially considering the incoming pounds data was in large whole numbers (such as 45000). Looking at the PoundsToTons() function, David figured that the original code must have gotten a drastically different answer when asking How many pounds are in a ton? ... [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 | Page 7Next »

Re: The 2,000 Pound Question

2005-11-17 13:45 • by Disgruntled DBA
Damn you Metric System!  Damn you to hell!

Re: The 2,000 Pound Question

2005-11-17 13:46 • by Sen. Frist

First! [pi]

Re: The 2,000 Pound Question

2005-11-17 13:46 • by Spencer
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?!

Re: The 2,000 Pound Question

2005-11-17 13:46 • by Mike

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.

Re: The 2,000 Pound Question

2005-11-17 13:51 • by James R. Carr
The real WTF here is that Americans still don't use the metric system.        

Re: The 2,000 Pound Question

2005-11-17 13:51 • by Mike Edenfield
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



Re: The 2,000 Pound Question

2005-11-17 13:53 • by RageingNonsense
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.

Re: The 2,000 Pound Question

2005-11-17 13:56 • by AJR
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.

Re: The 2,000 Pound Question

2005-11-17 13:56 • by BlackTigerX
all I can say is [|-)]

Re: The 2,000 Pound Question

2005-11-17 13:56 • by MikeB
50923 in reply to 50917
Anonymous:

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.



He should've converted to dollars first.

Re: The 2,000 Pound Question

2005-11-17 13:57 • by Eyrie Owl
please tell me no one needed the link to the answer....

Re: The 2,000 Pound Question

2005-11-17 13:59 • by RevMike
50925 in reply to 50919
Anonymous:
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




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.

Re: The 2,000 Pound Question

2005-11-17 14:00 • by RevMike
50926 in reply to 50918
Anonymous:
The real WTF here is that Americans still don't use the metric system.        


No, the real WTF is that the rest of the world has been duped into using that inferior system.

Re: The 2,000 Pound Question

2005-11-17 14:05 • by Yoey
50927 in reply to 50926
RevMike:
Anonymous:
The real WTF here is that
Americans still don't use the metric system.     
  


No, the real WTF is that the rest of the world has been duped into using that inferior system.




Because a system based on density of water is pure madness.

Re: The 2,000 Pound Question

2005-11-17 14:06 • by AJR
50928 in reply to 50925
RevMike:
Anonymous:
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




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.




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

Re: The 2,000 Pound Question

2005-11-17 14:07 • by Otac0n
50929 in reply to 50926

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.

Re: The 2,000 Pound Question

2005-11-17 14:09 • by kipthegreat
50930 in reply to 50920
Alex Papadimoulis:



public static decimal PoundsToTons(decimal pounds)
{
decimal poundFactor = 0.4535924m;
decimal tonFactor = 907.1847m;
return Decimal.Divide((Decimal.Multiply(pounds, poundFactor)), tonFactor);
}



Anonymous:
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.




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

Re: The 2,000 Pound Question

2005-11-17 14:10 • by just a guy
50932 in reply to 50918
More exactly is:

"The real WTF here is that people from USA 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 !

Re: The 2,000 Pound Question

2005-11-17 14:11 • by RevMike
50933 in reply to 50928
AJR:


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


Yes.  There is the correct unit, and the evil imposters.

Re: The 2,000 Pound Question

2005-11-17 14:12 • by RevMike
50934 in reply to 50932
Anonymous:
More exactly is:

"The real WTF here is that people from USA 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 !



They don't count.

Re: The 2,000 Pound Question

2005-11-17 14:12 • by Maurits
50935 in reply to 50932
Anonymous:
More exactly is:

"The real WTF here is that people from USA 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 !



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.

Re: The 2,000 Pound Question

2005-11-17 14:14 • by RevMike
50936 in reply to 50929
Otac0n:

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.



There are some VMS tools that accept fortnights as interval units.

Re: The 2,000 Pound Question

2005-11-17 14:14 • by rogthefrog
You haul 16.0000017637 tons, and whaddayaget



(yes, I did compute it based on those factors)

Re: The 2,000 Pound Question

2005-11-17 14:15 • by Bologna
50938 in reply to 50930
the 'm' is for metric.  as in, "have you met rick?  he's the moron who coded this shit."

Re: The 2,000 Pound Question

2005-11-17 14:15 • by Adonoman
50939 in reply to 50930
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++)

Re: The 2,000 Pound Question

2005-11-17 14:18 • by bj
50940 in reply to 50925
just drop the last 7 from the tonFactor (907.184 instead of 907.1847) -
then the conversion works perfectly for non-metric tons. w00t.

Re: The 2,000 Pound Question

2005-11-17 14:22 • by warren
50941 in reply to 50926
RevMike:
Anonymous:
The real WTF here is that
Americans still don't use the metric system.     
  


No, the real WTF is that the rest of the world has been duped into using that inferior system.




Here you have it folks, today's WTF.

Re: The 2,000 Pound Question

2005-11-17 14:26 • by yep
50943 in reply to 50935

USA *is* the civilized world.

Re: The 2,000 Pound Question

2005-11-17 14:27 • by AJR
50944 in reply to 50933
RevMike:
AJR:


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


Yes.  There is the correct unit, and the evil imposters.


And which one is the correct unit is left as a cause of flame wars an exercise to the reader. ;)

Re: The 2,000 Pound Question

2005-11-17 14:28 • by dabocla
50945 in reply to 50935
Maurits:
Anonymous:
More exactly is:

"The real WTF here is that people from USA 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 !



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.




Hrm, I think I would rather keep using the numbers like 5280, 1.54, (9/5)+32, 12, 3, 2000, 2200, 3.785 etc,
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

Re: The 2,000 Pound Question

2005-11-17 14:28 • by dubwai
50946 in reply to 50935

Maurits:
Anonymous:
More exactly is:
"The real WTF here is that people from USA 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 !


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.


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.

Re: The 2,000 Pound Question

2005-11-17 14:29 • by LeoPetr
50947 in reply to 50924
I did. There are 1000 kilograms in a real ton.;)

Re: The 2,000 Pound Question

2005-11-17 14:30 • by pbounaix
50948 in reply to 50930

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.

Re: The 2,000 Pound Question

2005-11-17 14:30 • by Xepol

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!

Re: The 2,000 Pound Question

2005-11-17 14:32 • by Anonymoose
> and disabled rounding for debugging purposes.



WTF?



Explain.  Both 'how?' and, well, 'why?'

Re: The 2,000 Pound Question

2005-11-17 14:32 • by pbounaix
50951 in reply to 50937

rogthefrog:
You haul 16.0000017637 tons, and whaddayaget

(yes, I did compute it based on those factors)


 


lol... older w/ more debt!

Re: The 2,000 Pound Question

2005-11-17 14:36 • by RevMike
50952 in reply to 50935
Maurits:
Anonymous:
More exactly is:

"The real WTF here is that people from USA 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 !



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.


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.

Re: The 2,000 Pound Question

2005-11-17 14:38 • by RevMike
50953 in reply to 50947
LeoPetr:
I did. There are 1000 kilograms in a real ton.;)


Hey, Leo.  Glad you could join us from the Peoples' Republic of Canuckistan.  :)

Re: The 2,000 Pound Question

2005-11-17 14:39 • by JohnO
50954 in reply to 50930
kipthegreat:
Alex Papadimoulis:


public static decimal PoundsToTons(decimal pounds)
{
decimal poundFactor = 0.4535924m;
decimal tonFactor = 907.1847m;
return Decimal.Divide((Decimal.Multiply(pounds, poundFactor)), tonFactor);
}


Anonymous:
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.


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


The ms are for decimal literals.

Re: The 2,000 Pound Question

2005-11-17 14:41 • by WTFer
50955 in reply to 50945
dabocla:
Maurits:
Anonymous:
More exactly is:

"The real WTF here is that people from USA 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 !



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.




Hrm, I think I would rather keep using the numbers like 5280, 1.54, (9/5)+32, 12, 3, 2000, 2200, 3.785 etc,
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


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?

Re: The 2,000 Pound Question

2005-11-17 14:45 • by Djinn
50956 in reply to 50936
RevMike:
Otac0n:

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.



There are some VMS tools that accept fortnights as interval units.




I come for the wisdom, I stay for the trivia, and I won't leave for a buck.

Re: The 2,000 Pound Question

2005-11-17 14:50 • by DS
50957 in reply to 50952
>> Today you conform in currency.



ROFLOL!!

Go ahead and check $ / € exchange rates and see tendency for yourself...



LP,

Dejan









Re: The 2,000 Pound Question

2005-11-17 14:51 • by rhett
50958 in reply to 50924

Anonymous:
please tell me no one needed the link to the answer....


I did.  Similar to how I would need to look up what a cubit or stadia was.

Re: The 2,000 Pound Question

2005-11-17 14:54 • by Bob
50959 in reply to 50932
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.    

Re: The 2,000 Pound Question

2005-11-17 14:54 • by Paul Tomblin
50960 in reply to 50935
Maurits:

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.




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.

Re: The 2,000 Pound Question

2005-11-17 14:54 • by RevMike
50961 in reply to 50957
Anonymous:
>> Today you conform in currency.



ROFLOL!!

Go ahead and check $ / € exchange rates and see tendency for yourself...



LP,

Dejan



Now compare unemployment rates, growth rates, etc.  Please tell me why I shouldn't be laughing.

Re: The 2,000 Pound Question

2005-11-17 14:55 • by ComputerGuyCJ
50962 in reply to 50918
Anonymous:
The real WTF here is that Americans still don't
use the metric system.        




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.

Re: The 2,000 Pound Question

2005-11-17 14:56 • by RevMike
50963 in reply to 50959
Anonymous:
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.    


Fascist!!  Why Don't You Move to Canada!!

Re: The 2,000 Pound Question

2005-11-17 14:56 • by osp70
50964 in reply to 50952

RevMike:
Maurits:
Anonymous:
More exactly is:
"The real WTF here is that people from USA 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 !


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.


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.


 


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.


 


 

Re: The 2,000 Pound Question

2005-11-17 15:01 • by scpoRIch
50965 in reply to 50946
dubwai:

Maurits:
Anonymous:
More exactly is:
"The real WTF here is that people from USA 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 !


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.


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.





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...

« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5 | Page 6 | Page 7Next »

Add Comment