Absurdism corner

Discussion in 'Offtopic Discussions' started by Bosbeetle, Aug 27, 2010.

?

Why?

  1. ¿

    10.4%
  2. Hello World

    16.1%
  3. Non-euclidian geometry

    26.9%
  4. Several at once

    10.4%
  5. Behind a tree in dull lane

    9.8%
  6. Something completely different

    26.4%
  1. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    10,747
    Location:
    Somewhere off the coast of the EU
    Reads like a clip from that latest real world incarnation of the Larry Sanders show. Cut to Rip Torn.
     
  2. Klumpen

    Klumpen Run away! Run away!

    Joined:
    Jan 5, 2012
    Messages:
    6,541
    Location:
    Uncanny Valley
  3. Klumpen

    Klumpen Run away! Run away!

    Joined:
    Jan 5, 2012
    Messages:
    6,541
    Location:
    Uncanny Valley
  4. Klumpen

    Klumpen Run away! Run away!

    Joined:
    Jan 5, 2012
    Messages:
    6,541
    Location:
    Uncanny Valley
  5. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,661
    Looking for the part of the post where something has "gone wrong". Can't see any problems.
     
    rygD, ClockworkCoder and Djoga'Ro like this.
  6. ElPoco

    ElPoco Very Active Member

    Joined:
    Feb 16, 2012
    Messages:
    700
    Location:
    Paris, France
    The cat's aren't neutered :(
     
  7. Binky

    Binky Death's Steed Staff Member

    Joined:
    May 28, 2003
    Messages:
    6,900
    Location:
    16A (TO)
    The young lad/lass up there looks like a quick learner. I know that with that sort of early-years education, we can prevent children becoming IoT developers.

    Talk to your kids about web security - before someone else does.
     
    ible, Djoga'Ro and rSl like this.
  8. ClockworkCoder

    ClockworkCoder Chaotic Neutral

    Joined:
    Jan 21, 2016
    Messages:
    886
    Location:
    Menzoberranzan
  9. FBnil

    FBnil Ready to Champion the Pyra to the World...

    Joined:
    Dec 14, 2012
    Messages:
    2,598
    Location:
    Yurp
    HTML:
    javascript:var a=function(){alert(0.1*0.2); }()
    put that into your URL (if you have FireFox)
     
  10. jparish1977

    jparish1977 Member

    Joined:
    Oct 1, 2016
    Messages:
    79
    Is it the pseudo url, floating point math, alert dialog, or firefox that you find the most absurd? (Now I have to remember which machine I have firefox on to see if it does something unexpected)

    Sent from my SM-N950U using Tapatalk
     
  11. Binky

    Binky Death's Steed Staff Member

    Joined:
    May 28, 2003
    Messages:
    6,900
    Location:
    16A (TO)
    Iceweasel 38.5 here. Nothing happens.

    I'm curious to know what you'd expect to happen. Presumably something absurd?
     
  12. Djoga'Ro

    Djoga'Ro moonstruck

    Joined:
    Apr 3, 2016
    Messages:
    819
    Pale Moon 28.5.0 here. Nothing happens.
    --- Double Post Merged, May 18, 2019 at 11:20 AM, Original Post Date: May 18, 2019 at 11:18 AM ---
    Maybe absurd are we, trying it, expecting something to happen and getting confused. ?
     
  13. jparish1977

    jparish1977 Member

    Joined:
    Oct 1, 2016
    Messages:
    79
    I assume the expectation is an alert dialog displaying a slightly inaccurate value on browsers that support javascript pseudo urls

    Sent from my SM-N950U using Tapatalk
     
  14. FBnil

    FBnil Ready to Champion the Pyra to the World...

    Joined:
    Dec 14, 2012
    Messages:
    2,598
    Location:
    Yurp
    @Binky @Djoga'Ro It would popup an alert dialog with "0.020000000000000004" and an OK button. The floating point of JS is not that good.

    I have an old FireFox, maybe they removed it in the new FF. Try Waterfox instead, it worked there.
     
    Djoga'Ro likes this.
  15. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    16,661
    What is "not that good" about it? Do the same thing in C and you get 0.02000000141561031341552734375. That's just the nature of floating point numbers in a computer, you can't represent an infinite precision decimal, you can only represent "close enough", and if you'll notice, the JavaScript output is actually closer to what you'd expect than the C. Or is that the "not that good"? That it produces a different result than a true IEEE754 representation should?
     
    xnopasaranx and Djoga'Ro like this.
  16. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    10,747
    Location:
    Somewhere off the coast of the EU
    You mean an infinite precision binary number, presumably. In decimal, the answer is 0.02 exactly, or 1/50 (because you're calculating 1/5 x 1/10). In binary that's slightly more than 0.00000001 (1/64), presumably an infinite precision binary, and when you try to store that in floating point, you effectively try to shift the decimal until the number becomes an integer; all of the digits are to the left, but with an infinite precision or simply too precise number that's simply not possible so it truncates it at its maximum resolution,

    You could argue that this would be better if it used a decimal mantissa, so that it stored 2x10^-2 exactly, but in terms of the transistors and things inside a chip, when you have to divide by 10 it's relatively a killer. Dividing by 2 is simply a matter of shifting the bits one stop to the right and discarding the carry (also known as an ASR; an arithmetic shift right), which is easy to do in terms of transistors and traces. To divide by 10 (110 in binary) you're asking it to do long division every time, so it would be much slower. A slight loss of precision is usually considered preferable; in the javascript you're only out by something like 2.842170943040401e-14% (according to python's limited maths ability)
     
    FBnil and Djoga'Ro like this.
  17. Elw3

    Elw3 ƐʍlƎ

    Joined:
    Jul 21, 2013
    Messages:
    925
  18. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    10,747
    Location:
    Somewhere off the coast of the EU
    It's Jake's mate with the extra hand!
     
  19. Elw3

    Elw3 ƐʍlƎ

    Joined:
    Jul 21, 2013
    Messages:
    925
  20. Klumpen

    Klumpen Run away! Run away!

    Joined:
    Jan 5, 2012
    Messages:
    6,541
    Location:
    Uncanny Valley

Share This Page

Loading...