• (cs)

    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.

  • Eldon (unregistered) in reply to justsomedude
    justsomedude:
    pjt33:
    That's how you know it was a chemistry question. If it had been a physics question the correct answer would have been 0.4N (assuming it to be in close proximity to the surface of the Earth).

    N is a measure of force, the question was about weight. If you had been in a physics test you would have got that one wrong.

    Weight is a force, you are probably thinking about mass

  • (cs)

    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

  • Mick (unregistered) in reply to Modern believer in scientology
    Modern believer in scientology:
    Methuzella wrote: "And I increasingly get the impression that the only people in the world who seem to think the Old Testament is anything even remotely literal are the people who want to argue that Science is right and the bible is wrong and never the twain shall meet."

    Well, just exclude christian fundamentalists and all the americans who in surveys declare that they think that everything described in the bible is true, that evolution is false, and you got it... Sacred books of revelation and science cannot meet because revelations are about revealed truths that must be accepted without thinking, while science is about facts and critical thinking. A revelation is written in stone, while science is constantly evolving as theories must improve to reflect correctly the facts of the physical world. But I am glad to know that the bible is not to be taken literally, I guess this means that sins are metaphoric expressions of moral advices, there's no hell and even the concept of soul might be a simple beautification of the idea of human nature. So good to know that the ten commandments are just metaphoric ideas, so I cn actually understand them as I see fit, which after all what all military chaplains have been doing when it comes to the "thou shalt not kill" thingy, since blessing men who are going to kill other men doesn't seem quite a christian idea... But luckily we are XXI century people, and we don't hold irrational beliefs and superstitious ideas.

    captcha: ideo, I create anything with my imagination and make it come true

    The Old Testament != the entire Bible. Not a literal book != No lessons to be taken from

    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.

  • laziness_exists (unregistered)

    Typing an underscore can be a pain. I personally love this wrapper method.

  • (cs) in reply to laziness_exists
    laziness_exists:
    Typing an underscore can be a pain. I personally love this wrapper method.
    Depends on your keyboard, I guess. On my keyboard, 8 is a shifted underscore. The top row of the main part is ²&é"'(-è_çà)=.
  • Decius (unregistered) in reply to Kaniu

    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.

  • Peteris (unregistered) in reply to Anonymous Genius

    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.

  • kcim (unregistered)

    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.

  • Tynam (unregistered) in reply to Mick

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

  • Captcha:laoreet (unregistered) in reply to Tynam
    Tynam:
    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.

    There's an xkcd for that.

    (154)

  • Neil (unregistered) in reply to Ken B.
    Ken B.:
    PZ:
    22.0f/3 was quite a common way of representing PI in a rough way before frameworks came long and stuck 'official' PI constants in.
    Given that it's only accurate to 2 decimal places, I would think hard-coding "3.14" would be easier.

    Either that, or "355./113". It's only 1 character longer than "22.0f/3" and it's accurate to 6 decimal places.

    Assuming that PZ wanted an IEEE float, rather than a double, 355.f/113 would have exactly equalled π, within the limits of available precision.

  • beowulf (unregistered)

    PI cant still be calculated in some languages like VBA But you can use the math formular 4 * ATN(1) (arc tangent)

  • qbolec (unregistered)

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

  • Buho (unregistered) in reply to operagost

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

  • Jeremy (unregistered) in reply to KattMan
    KattMan:
    The Christian bible states that PI is 3. No floats needed back in those days I guess.

    Actually Noah needed a good number of them.

  • Jeremy (unregistered) in reply to ShatteredArm
    ShatteredArm:
    {"Maybe",__TIME__[7]&1}

    I see no problem with the computer making a decision for you if you're waffling. This is a solid implementation of "Maybe."

    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.

  • David Conrad (unregistered) in reply to Anonymous Genius
    Anonymous Genius:
    Yeah, apart from the missing '+' it seemed fairly reasonable to me. There are valid reasons for wanting to write your own rounding routine-- for example, in many financial applications, it is desirable to add something like 0.5000000001 instead of 0.5 to keep floating point error from causing the result of some calculations to round down erroneously.

    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.

  • David Conrad (unregistered) in reply to TGV
    TGV:
    you either take the Bible literally, or you don't. There is no FileNotFound option.

    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.

  • David Conrad (unregistered) in reply to Whosdr
    Whosdr:
    Any real computer or maths buff should know Pi is roughly 3.14159265358979323846264338327950288419716939937510582097494492307. Come on, is it really that hard to remember?

    You missed a spot. Near the end (of what you gave) it is ...494459..., not ...49449....

  • (cs) in reply to History Teacher
    History Teacher:
    Anonymous Genius:
    Yeah, apart from the missing '+' it seemed fairly reasonable to me. There are valid reasons for wanting to write your own rounding routine-- for example, in many financial applications, it is desirable to add something like 0.5000000001 instead of 0.5 to keep floating point error from causing the result of some calculations to round down erroneously.
    If you're using floating point numbers in a financial application, you're doing it wrong.

    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.

  • Whosdr (unregistered) in reply to David Conrad

    Typo. Not used to using the numpad but it was the quickest way. Why don't you give it a try?

    Fixed: 3.1415926535897932384626433832795028841971693993751058209749445923078

  • mschutte369 (unregistered)

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

    C    2      MULT     MYNBR    HLDVAL 
    C    MYNBR  SUB      HLDVAL   MYNBR 
    

    basically it's the same as coding this.

    MyNbr = MyNbr - (MyNbr * 2) 
    

    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.

    C          Z-SUB  MYNBR  MYNBR 
    

    which is the same as saying

    MYNBR = 0 - MYNBR
    
  • (cs) in reply to kcim
    kcim:
    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.
    It's not weird. Scientists simply have a different set of enemies. If you want to see rabid opposition from a scientist, all you have to do is suggest to them that astrology or homeopathy really works.
  • Joe (unregistered) in reply to Heinz
    Heinz:
    You can get this code to fail:

    /**

    • Tests if {@link XXXX} class extends {@link Object} class. */ @Test public void testInheritance() { Assert.assertTrue("Class does not extends Object class.", instance instanceof Object); }

    Simply pass in "null".

    Pass into what? It's a class method with no arguments that tests itself.

    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?

  • radarbob (unregistered) in reply to Nagesh
    Nagesh:
    PZ:
    22.0f/3 was quite a common way of representing PI in a rough way before frameworks came long and stuck 'official' PI constants in.

    In the India we using 22/7, no 22/3.

    Thank you, come again!

    There's no comma-pause when the REAL Nagesh mispromunchinates.

  • Joe (unregistered) in reply to Jamal
    Jamal:
    Remember: it is always praferrable to put the inside of the function in one line to spend less space and make the client happy:
    public static int getNegativeOfNumber ( int num ) 
    {
       return -1*Math.abs(num);
    }
    

    And then there's the inscrutable C/C++ branchless approach:

    static inline int get_negative_of_number(int num) { return (num & (num >> 31)) - (num & ~(num >> 31)); }
    
  • Joe (unregistered) in reply to Jeremy
    Jeremy:
    ShatteredArm:
    {"Maybe",__TIME__[7]&1}

    I see no problem with the computer making a decision for you if you're waffling. This is a solid implementation of "Maybe."

    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.

    I'd say the answer is a definite maybe.

  • Joe (unregistered) in reply to Joe
    Joe:
    And then there's the inscrutable C/C++ branchless approach:
    static inline int get_negative_of_number(int num) 
    { 
        return (num & (num >> 31)) - (num & ~(num >> 31)); 
    }
    
    Assuming, of course, the spec was to return a negative number given any 'int'. And for extra bonus points, there's the inscrutable C/C++ float version:
    static inline float get_negative_of_float(float f) 
    { 
        union { float f; int i; } x; 
        x.f = f; 
        x.i |= 0x80000000U;
        return x.f; 
    }
  • RonPaul (unregistered)

    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)

  • RonPaul (unregistered) in reply to RonPaul

    Double as well.

    Math.Round(double, intDecimalPlaces, MidpointRounding.AwayFromZero)

  • David (unregistered) in reply to Jay
    Jay:
    At the risk of being mildly serious: The Bible gives the measurements of a certain object, mentioning that the diameter is 10 and the circumference is 30.

    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.

  • Luiz Felipe (unregistered) in reply to Heinz
    Heinz:
    You can get this code to fail:
    /**
     * Tests if {@link XXXX} class extends {@link Object} class.
     */
    @Test
    public void testInheritance() {
        Assert.assertTrue("Class does not extends Object class.",
            instance instanceof Object);
    }
    

    Simply pass in "null".

    Null is void, and void is not an object. where is your object's gawd now?

  • Luiz Felipe (unregistered) in reply to Tud
    Tud:
    Vitus:
    Nope, Pi is the ratio of circumference and diameter of a circle and that can change. The numeric methods to calculate it you mention are only valid in an Euclidean space. So yes there is conceivably a time and place where it was 3.0.
    Vitus:
    Wrong. Pi is dependent on the curvature of space. In a largely flat space it is what we measure it to be. In a rather curved space you will find it smaller or bigger depending on the type of curvature. In the early universe it would have been much smaller so there was a time when it was 3.
    const real MATHEMATICAL_CONSTANT_1 := 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + ... = 3.1415926535897932384...
    const real GEOMETRICAL_CONSTANT_1 := euclidean_geometry.NewCircle().circumference / euclidean_geometry.NewCircle().radius = 3.1415926535897932384...
    const real PHYSICAL_CONSTANT_1 := current_universe.drawCircle().circumference / current_universe.drawCircle().radius = 3.1415926535897932384...
    if (current_universe.getGeometry == euclidean_geometry)
    {
       assert MATHEMATICAL_CONSTANT_1 == GEOMETRICAL_CONSTANT_1 == PHYSICAL_CONSTANT_1
    }
    

    And since they're the same, we just call that value "Pi".

    Assetion fail: current_universe.getGeometry returned space_time_continuum class.

  • Luiz Felipe (unregistered) in reply to Mick
    Mick:
    Modern believer in scientology:
    Methuzella wrote: "And I increasingly get the impression that the only people in the world who seem to think the Old Testament is anything even remotely literal are the people who want to argue that Science is right and the bible is wrong and never the twain shall meet."

    Well, just exclude christian fundamentalists and all the americans who in surveys declare that they think that everything described in the bible is true, that evolution is false, and you got it... Sacred books of revelation and science cannot meet because revelations are about revealed truths that must be accepted without thinking, while science is about facts and critical thinking. A revelation is written in stone, while science is constantly evolving as theories must improve to reflect correctly the facts of the physical world. But I am glad to know that the bible is not to be taken literally, I guess this means that sins are metaphoric expressions of moral advices, there's no hell and even the concept of soul might be a simple beautification of the idea of human nature. So good to know that the ten commandments are just metaphoric ideas, so I cn actually understand them as I see fit, which after all what all military chaplains have been doing when it comes to the "thou shalt not kill" thingy, since blessing men who are going to kill other men doesn't seem quite a christian idea... But luckily we are XXI century people, and we don't hold irrational beliefs and superstitious ideas.

    captcha: ideo, I create anything with my imagination and make it come true

    The Old Testament != the entire Bible. Not a literal book != No lessons to be taken from

    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.

    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.

  • Luiz Felipe (unregistered) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    kcim:
    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.
    It's not weird. Scientists simply have a different set of enemies. If you want to see rabid opposition from a scientist, all you have to do is suggest to them that astrology or homeopathy really works.
    No, if you only suggest to them that it works, they will not be upset. You must put the burden of proving that homeopathy don`t works on them. Inversion of proof, it is the people that believe in astrology or whatever that must prove that astrology works, not some other people, this upset every person that has a little of intelligence, logic and rationality. If you cant prove what you are saying, then you are lier and charlatan.
  • KMag (unregistered) in reply to Kaniu

    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.

  • KMag (unregistered) in reply to Kaniu
    Kaniu:
    Round isn't actually that bad. It's a way to replace C#'s default rounding "half towards even" with a more conventional "half towards up".

    The real WTF is why would anyone want to use banker's rounding as a default method. http://msdn.microsoft.com/en-us/library/aa340227(v=vs.71).aspx http://en.wikipedia.org/wiki/Rounding#Round_half_to_even

    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.

  • AN AMAZING CODER (unregistered) in reply to Nagesh
    Nagesh:
    TGV:
    Sayer: you either take the Bible literally, or you don't. There is no FileNotFound option.
    I don't. You got a problem with that?

    But even so, the literal meaning of "thirty cubits" is not "30.0 cubits exactly". None of the extant manuscript include the word "exactly" (or rather, any words in the original language, probably biblical Hebrew, that would support such a translation). There is no reason to exist any such manuscript ever existed.

    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.

  • (cs) in reply to Luiz Felipe
    Luiz Felipe:
    No, if you only suggest to them that it works, they will not be upset. You must put the burden of proving that homeopathy don`t works on them. Inversion of proof, it is the people that believe in astrology or whatever that must prove that astrology works, not some other people, this upset every person that has a little of intelligence, logic and rationality. If you cant prove what you are saying, then you are lier and charlatan.
    So let's see the proof of your last statement.
  • TheJim (unregistered) in reply to justsomedude

    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.

  • TheJim (unregistered) in reply to Cbuttius

    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)

  • TheJim (unregistered) in reply to Vitus

    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.

  • (cs) in reply to C-Derb
    C-Derb:
    Back in 1950 you could fool people into thinking $.57 9/10 is 3 cents cheaper than $.60
    I think US gas in 1950 was perhaps 18 cents per gallon, rather than 60 cents.
  • negro (unregistered) in reply to Shaftway

    http://msdn.microsoft.com/en-us/library/ms131275.aspx

    What exactly is this function lacking?

  • Sigh (unregistered)

    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.

  • SrederMogul (unregistered)
    Comment held for moderation.
  • Jeanne Zimmerman (unregistered)

    Informative Article. I am very glad to read this excellent post

  • Brian Stearns (unregistered)
    Comment held for moderation.

Leave a comment on “The Object Test, a New PI, and More SHEEIT”

Log In or post as a guest

Replying to comment #:

« Return to Article