Johnnei's World
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
orhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 3 days ago

Floating point arithmetics

eviltoast.org

message-square
41
link
fedilink
727

Floating point arithmetics

eviltoast.org

orhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 3 days ago
message-square
41
link
fedilink
  • marcos@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    13
    ·
    3 days ago

    It’s not “mimicking” a fraction. It is a fraction.

    It’s also the most compact fraction representation around.

    • WhiskyTangoFoxtrot@lemmy.world
      link
      fedilink
      arrow-up
      20
      arrow-down
      1
      ·
      3 days ago

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

      • BigMikeInAustin@lemmy.world
        link
        fedilink
        English
        arrow-up
        35
        ·
        edit-2
        3 days ago

        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 days ago

          How many decimal places can it be stretched?

        • MyBrainHurts@piefed.ca
          link
          fedilink
          English
          arrow-up
          2
          ·
          3 days ago

          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 days ago

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

        • calcopiritus@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          3 days ago

          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 days ago

            You are proposing that can represent the entire rational set?

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

              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
          ·
          3 days ago

          No. They all need to mimic certain numbers.

          • marcos@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            2 days ago

            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 days ago

              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.

  • 1.58K users / day
  • 5.4K users / week
  • 9.23K users / month
  • 19.1K users / 6 months
  • 1 local subscriber
  • 26.8K subscribers
  • 1.74K Posts
  • 59K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.12
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org