Upvote!
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
orhtej2@eviltoast.org to Programmer Humor@programming.devEnglish · 20 hours ago

Floating point arithmetics

eviltoast.org

message-square
44
fedilink
691

Floating point arithmetics

eviltoast.org

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

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

    • BigMikeInAustin@lemmy.world
      link
      fedilink
      English
      arrow-up
      35
      ·
      edit-2
      20 hours 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
        ·
        19 hours ago

        How many decimal places can it be stretched?

      • MyBrainHurts@piefed.ca
        link
        fedilink
        English
        arrow-up
        2
        ·
        18 hours 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
      ·
      17 hours ago

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

      • calcopiritus@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        13 hours 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
          ·
          47 minutes ago

          You are proposing that can represent the entire rational set?

          • calcopiritus@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            30 minutes 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
        ·
        17 hours ago

        No. They all need to mimic certain numbers.

        • marcos@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          46 minutes 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
            ·
            9 minutes 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.

  • 4.05K users / day
  • 5.93K users / week
  • 9.93K users / month
  • 19.9K users / 6 months
  • 1 local subscriber
  • 26.8K subscribers
  • 1.74K Posts
  • 60.8K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.6
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org