Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-265288

Not all float/double tags in macro arguments are uniquely stringified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.2 Pre-release 2, 1.20.2, 23w41a, 23w42a, 23w43a, 23w45a, 1.20.3 Release Candidate 1, 1.20.4, 24w04a, 24w14a, 1.21, 24w33a, 1.21.1
    • None
    • Confirmed
    • Commands
    • Low
    • Platform

      The bug

      Not all float/double macro arguments are uniquely (in a way that can be distinguished at least from other values) stringified because the maximum number of fraction digits is limited to 15. This could result in multiple float/double tags being converted to the same string representation.

      How to reproduce

      a.mcfunction
      $say $(a)
      

      Float tags

      Run

      function a {a: 1.4E-45f}
      Expected behavior

      Unique representation like 0.000000000000000000000000000000000000000000001401298464324817

      Actual behavior

      0

      Double tags

      Run

      function a {a: 4.9E-324d}
      Expected behavior

      Unique representation like 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000049

      Actual behavior

      0

            Unassigned Unassigned
            intsuc intsuc
            Votes:
            10 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              CHK: