• CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    arrow-down
    5
    ·
    edit-2
    8 hours ago

    I mean, an application could exist where this isn’t even wrong. Maybe as a “subroutine” of another algorithm that only needs a truly composite number most of the time to work.

    That this reads as a joke says a lot about what application we’re intuitively expecting.

    Edit: Not sure why this is being downvoted.

    • ulterno@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      6 hours ago

      Edit: Not sure why this is being downvoted.

      Perhaps because it would do better, being replaced with noop.

      A link time optimiser might actually do so.

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        5 hours ago

        That’s kind of what I meant by putting “subroutine” in quotes. You obviously wouldn’t write it like this, you’d just use a random large number with a bit of explanation.

        Oh well, live and learn. I’ll try to be clearer next time.