• SAF (unregistered)

    I believe that's public static final int PI 42 Then we'd all be enlightened

  • jdr (unregistered)

    ... that the submitter has no idea that in the context of this API, "PI" stands for "Processing Instruction", not the Greek letter.

  • David Coppens (unregistered)

    Sorry, what was the question?

  • (cs)

    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.

  • David Coppens (unregistered)

    Wasn't it Sun that invented the 'use fully qualified' names convention? PI seems to be rather unclear in that sense.

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

  • (cs) in reply to Someone You Know
    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.

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

  • 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

  • (cs)

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

  • 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
  • (cs)

    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.

  • (cs)

    Actually, Pi has some weird properties.

    /knows Pi to 50 decimal places...somehow

  • JimM (unregistered) in reply to MET
    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...
  • (cs)

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

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

  • Strictnein (unregistered) in reply to D2oris
    D2oris:
    Actually, Pi has some weird properties.

    /knows Pi to 50 decimal places...somehow

    Seriously, rick rolling still?

  • JimM (unregistered) in reply to akatherder
    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!

  • (cs)

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

  • fanguad (unregistered) in reply to JimM

    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.

  • Scrag (unregistered)

    scrape scrape, scrape scrape; "there must be something left in this barrel!!"

  • Chris Ridenour (unregistered)

    I bet the Irish girl knows ALL the digits to Pi...

  • Anon (unregistered)

    Irish girl can "PI" me any day!

  • Shinobu (unregistered)

    Public Const π = 3.14159265358979

  • Michael (unregistered) in reply to David Coppens
    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.
  • floorpie (unregistered)

    Mmm... pie

  • Michael (unregistered) in reply to JimM
    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.
  • Anon (unregistered) in reply to Chris Ridenour
    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.

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

  • Seth (unregistered) in reply to Someone You Know

    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.

  • CAPTCHA: nulla (unregistered)

    not a wtf at all by nice try

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

  • Tom (unregistered)

    *sad

  • Shane (unregistered)

    Isn't it a day early to be discussing Pi anyway. Seeing as tomorrow is Pi Day (3/14).

  • I walked the dinosaur (unregistered)
  • 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...

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

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

  • (cs)

    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".
  • dkf (unregistered) in reply to Shinobu
    Shinobu:
    Public Const π = 3.14159265358979
    public static final double e = 3.14159265358979;
  • (cs) in reply to Shane

    I, and everyone outside the US, make it 14/3, which must be IMAP day.

    Happy IMAP day for tomorrow, everyone!

  • (cs)
  • (cs) in reply to Theo
    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.
  • Sionnach (unregistered)

    ...is Irish and thinks you're all mad

  • Southern (unregistered)

    Who reads the documentation anyway?

  • (cs) in reply to charonme
    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.

  • 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!!!!

  • Anomynous (unregistered) in reply to floorpie

    Mmm... Irish girl

  • (cs) in reply to dpm
    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 (pir^2, pid, 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.

  • Paolo G (unregistered) in reply to WhiskeyJack
    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.

Leave a comment on “My Pi Goes to Twelve”

Log In or post as a guest

Replying to comment #:

« Return to Article