Comment On My Pi Goes to Twelve

The value of Pi is not as 3.14159265…ish as many of us would like to believe. Legislators in Indiana once declared Pi as 3.2, 4, and 3.23. Staunch biblical mathematicians insist that it's 3. The whole thing is a mess: everyone just has to have their very own Pi. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: My Pi Goes to Twelve

2008-03-13 08:03 • by SAF (unregistered)
I believe that's
public static final int PI 42
Then we'd all be enlightened

"The REAL WTF is ..."

2008-03-13 08:05 • by jdr (unregistered)
... that the submitter has no idea that in the context of this API, "PI" stands for "Processing Instruction", not the Greek letter.

Re: My Pi Goes to Twelve

2008-03-13 08:06 • by David Coppens (unregistered)
Sorry, what was the question?

Re: My Pi Goes to Twelve

2008-03-13 08:06 • by Someone You Know
Actually, the page you linked to says that Indiana legislators didn't declare the value of pi to be anything unusual — one of them tried to do so and failed.

And "PI" doesn't always mean the ratio of a circle's circumference to its diameter.

Re: My Pi Goes to Twelve

2008-03-13 08:07 • by David Coppens (unregistered)
Wasn't it Sun that invented the 'use fully qualified' names convention? PI seems to be rather unclear in that sense.

Re: My Pi Goes to Twelve

2008-03-13 08:12 • by Luke (unregistered)
I never posted anything like this, not even did I say any bad words about MFD but...
This is the worst thing ever on the first page. On sidebar it would be flamed for sure and recieve a bad vote.

Re: My Pi Goes to Twelve

2008-03-13 08:13 • by dpm
183300 in reply to 183296
Someone You Know:
Actually, the page you linked to says that Indiana legislators didn't declare the value of pi to be anything unusual — one of them tried to do so and failed.


Well, it cleared the Committee on Education, and was passed by the House 67-0, so you have to admit that *some* legislators (notice he did not say "legislature") did in fact declare pi to be an inaccurate value. It simply didn't get far enough to become law.

Re: My Pi Goes to Twelve

2008-03-13 08:15 • by Paul (unregistered)
The PI in the screenshot is javax.swing.text.html.parser.DTDConstants.PI and therefore nothing to do with mathematical PI whatsoever. The title at the top of the table (not shown in the screenshot) makes this clear. Even without that, the fact that it's an int should be a clue!

The mathematical constant PI is found at java.lang.Math.PI and is a double with the value 3.141592653589793

So not a WTF at all.

Re: My Pi Goes to Twelve

2008-03-13 08:17 • by the real wtf (unregistered)
is that this is todays wtf
http://www.docjar.com/docs/api/javax/swing/text/html/parser/DTDConstants.html#PI
surely someone has something better to submit than this

Which day of the week is it?

2008-03-13 08:21 • by OzPeter
MFD comes out on Mon, Wed and Fri.
MFD sucks big time.
This WTF sucks big time.

Thus it must be Mon Wed or Fri.

So which day of the week is it??

And how come no one has submitted a MFD comment that was printed out, put on a wooden table and photographed???


Re: My Pi Goes to Twelve

2008-03-13 08:22 • by Polar (unregistered)
Were no strangers to love
You know the rules and so do i
A full commitments what Im thinking of
You wouldnt get this from any other guy

I just wanna tell you how Im feeling
Gotta make you understand

* never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Re: My Pi Goes to Twelve

2008-03-13 08:35 • by MET
I think this is a big WTF. All it takes is for someone to statically import these constants, which could be done for some other values without realising PI is present. Then they have a golden opportunity to shoot themselves in the foot by then referring to PI and expecting 3.14... . One of my golden rules of programming is to do things in a way that gives users of my code the least chance to get it accidentally wrong - partly because I may be the one who ends up tripping over obvious issues such as this.

I realise this natural conclusion of this argument would be that all constant names must be unique everywhere, which is obviously untenable. I do think however that PI is a special case as it is the one programming constant that all are familiar with a priori.

Anyway, why not use moderately self descriptive names like PROCESS_INSTRUCTION rather than the cryptic PI.

Re: My Pi Goes to Twelve

2008-03-13 08:42 • by D2oris
Actually, Pi has some weird properties.

/knows Pi to 50 decimal places...somehow

Re: My Pi Goes to Twelve

2008-03-13 08:43 • by JimM (unregistered)
183307 in reply to 183305
MET:
I think this is a big WTF. All it takes is for someone to statically import these constants, which could be done for some other values without realising PI is present...
And that's why import packagename.* is always a wtf...

Re: My Pi Goes to Twelve

2008-03-13 08:44 • by akatherder
I'm not familiar with java, but is it at all possible for someone to use javax.swing.text.html.parser.DTDConstants.PI when they were really trying to use java.lang.Math.PI? You know some has tried, and probably found a workaround to make it run.

The WTF is that they are referring to something as PI that isn't 3.1415...

Re: My Pi Goes to Twelve

2008-03-13 08:47 • by OJ (unregistered)
OK, I'll one up this.

I wrote some code where the number Pi is represented by integer value 262144 (2^18 for those who don't do logarithms in their head). The code handles fractions of Pi in fixed point arithmetic, so this works much better than actual Pi. The constant is internal to a single module, though.

Re: My Pi Goes to Twelve

2008-03-13 08:49 • by Strictnein (unregistered)
183311 in reply to 183306
D2oris:
Actually, Pi has some weird properties.

/knows Pi to 50 decimal places...somehow


Seriously, rick rolling still?

Re: My Pi Goes to Twelve

2008-03-13 08:55 • by JimM (unregistered)
183312 in reply to 183308
akatherder:
is it at all possible for someone to use javax.swing.text.html.parser.DTDConstants.PI when they were really trying to use java.lang.Math.PI?
It's more likely the other way round: i.e. you're doing something with an html parser and you also want to do arc / circular maths equations on some of the values (perhaps from the html). Note, however, that this scenario is still highly improbably.

The biggest issue would be if you tried
import static javax.swing.text.html.parser.DTDConstants.*
and
import static java.lang.Math.*
in the same class (see my previous comment for thoughts on input anything.*!)

p.s. haven't actually written any Java since I left uni so the syntax for static imports might be wrong!

Re: My Pi Goes to Twelve

2008-03-13 08:56 • by T $
The real WTF is that REQUIRED has a value of 2. If anything, it should have a value of 1 (as compared to 0, not required). Clearly the wrong function was circled here. And yet, there's that title and commentary...

Re: My Pi Goes to Twelve

2008-03-13 09:00 • by fanguad (unregistered)
183315 in reply to 183312
Actually, that case is okay. It's ambiguous, so Java will make you be specific. The case where it's bad is if you try to statically import DTDConstants.*, but *thought* you had statically imported Math.*

Re: My Pi Goes to Twelve

2008-03-13 09:04 • by Scrag (unregistered)
*scrape scrape*, *scrape scrape*; "there must be something left in this barrel!!"

Re: My Pi Goes to Twelve

2008-03-13 09:06 • by Chris Ridenour (unregistered)
I bet the Irish girl knows ALL the digits to Pi...

Re: My Pi Goes to Twelve

2008-03-13 09:06 • by Anon (unregistered)
Irish girl can "PI" me any day!

Re: My Pi Goes to Twelve

2008-03-13 09:07 • by Shinobu (unregistered)
Public Const π = 3.14159265358979

Re: My Pi Goes to Twelve

2008-03-13 09:14 • by Michael (unregistered)
183320 in reply to 183297
David Coppens:
Wasn't it Sun that invented the 'use fully qualified' names convention? PI seems to be rather unclear in that sense.
From the DTDConstants JavaDoc header:
The names of the constants correspond the the equivalent SGML constructs as described in "The SGML Handbook" by Charles F. Goldfarb.
So rather that create their own terms, Sun decided to re-use what already existed, and what people already recognized. I say good for them.

Re: My Pi Goes to Twelve

2008-03-13 09:15 • by floorpie (unregistered)
Mmm... pie

Re: My Pi Goes to Twelve

2008-03-13 09:16 • by Michael (unregistered)
183322 in reply to 183312
JimM:

The biggest issue would be if you tried
import static javax.swing.text.html.parser.DTDConstants.*
and
import static java.lang.Math.*
in the same class
Trying to do that would indeed be a real WTF.

Re: My Pi Goes to Twelve

2008-03-13 09:22 • by Anon (unregistered)
183325 in reply to 183317
Chris Ridenour:
I bet the Irish girl knows ALL the digits to Pi...


Damn! You beat me to it.
BTW, if Irish girl wants to beat...oh nevermind.

Irish girl

2008-03-13 09:26 • by han solito (unregistered)
Must meet irish girl, I offer a reward to be payed in theDailyWTF stickers to anyone who provides me with a name and more pictures of the irish girl. (not from bustedTees, I saw everything on their website)
I'm also planning to break into the BustedTees headquarters to get the info I want, otherwise I will not be able to read TheDailyWTF ever again, the feeling is worse than when applerumors.com confirmed the macbook air, or when I was a kid and they came up with a new power rangers toy every week and I couldn't afford any. Please bustedTees, I'm begging for your mercy or else.

Re: My Pi Goes to Twelve

2008-03-13 09:28 • by Seth (unregistered)
183327 in reply to 183296
Actually, what happened was that a nutcase wrote a math book which claimed Pi was 3, and got his legislator to propose requiring its use.

Re: My Pi Goes to Twelve

2008-03-13 09:29 • by CAPTCHA: nulla (unregistered)
not a wtf at all by nice try

Re: My Pi Goes to Twelve

2008-03-13 09:34 • by Tom (unregistered)
Irish Girl...oh dammit you pervs beat me to it...

It'll be a said day when St. Patrick's day is over.

Re: My Pi Goes to Twelve

2008-03-13 09:34 • by Tom (unregistered)
*sad

Re: My Pi Goes to Twelve

2008-03-13 09:44 • by Shane (unregistered)
Isn't it a day early to be discussing Pi anyway. Seeing as tomorrow is Pi Day (3/14).

Re: My Pi Goes to Twelve

2008-03-13 09:44 • by I walked the dinosaur (unregistered)

Re: My Pi Goes to Twelve

2008-03-13 09:47 • by John the incredible (unregistered)
Math.PI makes it so you'll never accidentally get the constant other than the one you want AND so your code is easier to read. It's only if there's two classes named Math with PI constants do you get into trouble...

Re: My Pi Goes to Twelve

2008-03-13 09:50 • by Theo (unregistered)
Yeah right.

Believe it or not, I've seen in a program a constant E which didn't have the mathematical value of e = 2.7128...
And I've seen someplace else a constant B which wasn't even a boolean! WTF?!?

PI is only two letters. What are the chances someone use it elsewhere with a different meaning to the mathematical PI? Huge.

Re: My Pi Goes to Twelve

2008-03-13 09:59 • by anon (unregistered)
Actually, that case is okay. It's ambiguous, so Java will make you be specific. The case where it's bad is if you try to statically import DTDConstants.*, but *thought* you had statically imported Math.*


I get those confused all the time.

Re: My Pi Goes to Twelve

2008-03-13 10:02 • by alyawn
Generally, Java developers would do this:

import javax.swing.text.html.parser.DTDConstants;
...
if (DTDConstants.PI == something) {
//this is a process instruction
}
double funStuff = otherStuff * Math.PI;
...
TRWTF is the import package.class.* "feature".

Re: My Pi Goes to Twelve

2008-03-13 10:05 • by dkf (unregistered)
183341 in reply to 183319
Shinobu:
Public Const π = 3.14159265358979
public static final double e = 3.14159265358979;

Re: My Pi Goes to Twelve

2008-03-13 10:11 • by masseyis
183345 in reply to 183332
I, and everyone outside the US, make it 14/3, which must be IMAP day.

Happy IMAP day for tomorrow, everyone!

Re: My Pi Goes to Twelve

2008-03-13 10:29 • by DaveK

Your assumptions are false

2008-03-13 10:30 • by charonme
183356 in reply to 183335
Staunch biblical mathematicians insist that it's 3

Your "staunch" "biblical" "mathematicians" assume that the shape of the object in question was cylindrical, which contradicts 1Kings 7:26. Also, to obtain a 5% more precise value of pi, they would have to measure both the circumference and diameter at the same place, which again contradicts 1Ki 7:23.

Re: My Pi Goes to Twelve

2008-03-13 10:32 • by Sionnach (unregistered)
...is Irish and thinks you're all mad

Re: My Pi Goes to Twelve

2008-03-13 10:41 • by Southern (unregistered)
Who reads the documentation anyway?

Re: Your assumptions are false

2008-03-13 10:51 • by WhiskeyJack
183378 in reply to 183356
charonme:
Staunch biblical mathematicians insist that it's 3

Your "staunch" "biblical" "mathematicians" assume that the shape of the object in question was cylindrical, which contradicts 1Kings 7:26. Also, to obtain a 5% more precise value of pi, they would have to measure both the circumference and diameter at the same place, which again contradicts 1Ki 7:23.


Actually, I just find it fascinating that even in ancient Biblical times they already knew some of this stuff.

Re: My Pi Goes to Twelve

2008-03-13 11:22 • by Googlefish (unregistered)
This WTF sucks.

So does this mean we can never use the letters "PI" to mean anything else? And if you're really looking for an int value for PI, then you are actually the WTF.

... or should I say, those big stupidheads at Sun ALSO made PI an integer!!! hahaha!!!! ZLOL dummies!!!!

Re: My Pi Goes to Twelve

2008-03-13 11:22 • by Anomynous (unregistered)
183397 in reply to 183321
Mmm... Irish girl

Re: My Pi Goes to Twelve

2008-03-13 11:28 • by Random832
183401 in reply to 183300
dpm:
Someone You Know:
Actually, the page you linked to says that Indiana legislators didn't declare the value of pi to be anything unusual — one of them tried to do so and failed.


Well, it cleared the Committee on Education, and was passed by the House 67-0, so you have to admit that *some* legislators (notice he did not say "legislature") did in fact declare pi to be an inaccurate value. It simply didn't get far enough to become law.


The proposed law in question did not declare the value of pi to be any identifiable value.

It specified a method for calculating the area of a circle which yields a result which, if one calculated the area by "pi" * r^2, would require "pi" to be one value.

It makes several assertions about the relationship of the lengths of arcs in a circle and the dimensions of an inscribed square in the same circle, which, if calculated by conventional means, would require pi and the square root of two to be several different values.

It does not include any recognition that any of the formulas we use these days (pi*r^2, pi*d, etc) as being accurate, nor does it at any point mention "pi" by name.

Claiming that it assigns a value, inaccurate or otherwise, to pi... is giving its author far too much credit.

Re: Your assumptions are false

2008-03-13 11:29 • by Paolo G (unregistered)
183402 in reply to 183378
WhiskeyJack:
charonme:
Staunch biblical mathematicians insist that it's 3

Your "staunch" "biblical" "mathematicians" assume that the shape of the object in question was cylindrical, which contradicts 1Kings 7:26. Also, to obtain a 5% more precise value of pi, they would have to measure both the circumference and diameter at the same place, which again contradicts 1Ki 7:23.


Actually, I just find it fascinating that even in ancient Biblical times they already knew some of this stuff.


They didn't. Check out the quotes and you'll see that they mention things being so many cubits across or so many cubits round, but nothing about the ratio of these two measurements being a constant.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment