Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. fixed point is taught wrong.

fixed point is taught wrong.

Scheduled Pinned Locked Moved Uncategorized
4 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • eniko@mastodon.gamedev.placeE This user is from outside of this forum
    eniko@mastodon.gamedev.placeE This user is from outside of this forum
    eniko@mastodon.gamedev.place
    wrote last edited by
    #1

    fixed point is taught wrong. instead of saying "to multiply two fixed point values you have to multiply them then shift them back into position" what it really should be is "when you multiply two fixed point values the result has a fractional precision in bits equal to the sum of the fractional precision of the two fixed point types multiplied"

    eniko@mastodon.gamedev.placeE jvmguy@mindly.socialJ 2 Replies Last reply
    0
    • eniko@mastodon.gamedev.placeE eniko@mastodon.gamedev.place

      fixed point is taught wrong. instead of saying "to multiply two fixed point values you have to multiply them then shift them back into position" what it really should be is "when you multiply two fixed point values the result has a fractional precision in bits equal to the sum of the fractional precision of the two fixed point types multiplied"

      eniko@mastodon.gamedev.placeE This user is from outside of this forum
      eniko@mastodon.gamedev.placeE This user is from outside of this forum
      eniko@mastodon.gamedev.place
      wrote last edited by
      #2

      this not only makes it easy to see *why* you have to shift (the fractional precision increased, so if you want to keep a lower one you have to shift) but it also makes it clear how multiplication between two fixed point types with different fractional precision works

      eniko@mastodon.gamedev.placeE 1 Reply Last reply
      0
      • eniko@mastodon.gamedev.placeE eniko@mastodon.gamedev.place

        this not only makes it easy to see *why* you have to shift (the fractional precision increased, so if you want to keep a lower one you have to shift) but it also makes it clear how multiplication between two fixed point types with different fractional precision works

        eniko@mastodon.gamedev.placeE This user is from outside of this forum
        eniko@mastodon.gamedev.placeE This user is from outside of this forum
        eniko@mastodon.gamedev.place
        wrote last edited by
        #3

        if you multiply a fixed point value with 2 bits of fractional precision and one with 4 bits you wind up with a result that has 6 bits of fraction. if you want a result with 3 bits of fraction you shift right by 6-3=3 bits

        this is easily understood, but only if the underlying concept is properly explained from the start

        1 Reply Last reply
        0
        • eniko@mastodon.gamedev.placeE eniko@mastodon.gamedev.place

          fixed point is taught wrong. instead of saying "to multiply two fixed point values you have to multiply them then shift them back into position" what it really should be is "when you multiply two fixed point values the result has a fractional precision in bits equal to the sum of the fractional precision of the two fixed point types multiplied"

          jvmguy@mindly.socialJ This user is from outside of this forum
          jvmguy@mindly.socialJ This user is from outside of this forum
          jvmguy@mindly.social
          wrote last edited by
          #4

          @eniko it’s a fun exercise to generalize that to mixed bases and mixed precision. Like a ternary number with 3 fractional digits and a binary number with 5 fractional digits yielding a base 12 number with 3 fractional digits.

          No, I have no use case for it. That’s just where that comment reminds me of.

          1 Reply Last reply
          1
          0
          • R relay@relay.publicsquare.global shared this topic
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups