• Winter_Oven@piefed.social
    link
    fedilink
    English
    arrow-up
    10
    ·
    3 days ago

    why is it a negative number for the floating point error one? Doesn’t a day counter either increments or be set to zero? are they minusing the day by the value it holds to make it zero instead of just assigning it zero?? Why??

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      16
      ·
      3 days ago

      At a guess, the counter goes up by fractions of a day internally, but it’s reset by subtracting the integer part, rounded.

      The original version wouldn’t have had the rounding but they “fixed” that after the first time they did a reset and it went to 1 not 0.

      As to why they wouldn’t just set it to zero, well here we have the joke under a microscope and it’s struggling to stay alive. Put the scalpel down.

    • jdnewmil@lemmy.ca
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 days ago

      … they were just about to experience a floating point error when the sign was put up.

    • obstbert@feddit.org
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      2
      ·
      edit-2
      2 days ago

      They’re using a signed 32-bit integer which can overflow to negative numbers. An unsigned integer would roll over to just 0, but then the joke wouldn’t work.

      Edit: I misread the question and was thinking about the title text