Brdsnest Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
orhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 3 天前

Floating point arithmetics

eviltoast.org

message-square
44
fedilink
752

Floating point arithmetics

eviltoast.org

orhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 3 天前
message-square
44
fedilink
  • WhiskyTangoFoxtrot@lemmy.world
    link
    fedilink
    arrow-up
    20
    arrow-down
    1
    ·
    3 天前

    Show how 1/3 can be precisely represented in floating point.

    • BigMikeInAustin@lemmy.world
      link
      fedilink
      English
      arrow-up
      36
      ·
      edit-2
      3 天前

      fl_numerator = 1

      fl_denominator = 3

      And division is a “stretch goal” once we get funding.

      • Gork@sopuli.xyz
        link
        fedilink
        arrow-up
        3
        ·
        3 天前

        How many decimal places can it be stretched?

      • MyBrainHurts@piefed.ca
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 天前

        As usual, the best jokes are in the comments. (Though goddamn I chuckled at the meme.)

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 天前

      Do you have a computer type that can represent the entire rational set?

      • calcopiritus@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        2 天前

        Yes. Have a structure with 2 BigInts. Treat one as the numerator. The other as denominators.

        It might not be efficient or fast. But it is possible.

        • marcos@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 天前

          You are proposing that can represent the entire rational set?

          • calcopiritus@lemmy.world
            link
            fedilink
            arrow-up
            2
            arrow-down
            1
            ·
            edit-2
            2 天前

            Yes that is correct. A BigInt represents the entire integer set.

            Rational numbers are defined by just 2 integers. Therefore, 2 BigInts represent the entire rational set.

      • WhiskyTangoFoxtrot@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        2 天前

        No. They all need to mimic certain numbers.

        • marcos@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 天前

          So, you have a notation that can represent the entire rational set?

          What exactly is being mimicked?

          • WhiskyTangoFoxtrot@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            2 天前

            So, you have a notation that can represent the entire rational set?

            No. That’s not what the meme is about, and that’s not what we’re arguing about.

            What exactly is being mimicked?

            Fractions.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 2.44K users / day
  • 5.82K users / week
  • 9.83K users / month
  • 19.9K users / 6 months
  • 1 local subscriber
  • 26.8K subscribers
  • 1.49K Posts
  • 41.4K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.5
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org