• sorrybookbroke@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    16 days ago

    Wait, why the the *1000 or mod 2? Won’t that give a 50\50 chance or the same as Math.round(Math.random).

    No shade, and I may be wrong myself I am very tired

    • mexicancartel@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      2
      ·
      15 days ago

      Probably to make the fractional random value between 0 and 1 to become an integer so that you can divisibility check for even with mod 2