Imprecise Float16 value reported by Float16.toString

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 25
    • Component/s: core-libs

      Please see below the difference b/w Float16 value and its string representation.

      jshell> Float.float16ToFloat(Float.floatToFloat16(0x1.fffffffP+14f))
      $5 ==> 32768.0

      jshell> Float16.valueOf(0x1.fffffffP+14f).toString()
      $6 ==> "32770.0"

      jshell> Float16.valueOf(0x1.fffffffP+14f).floatValue()
      $7 ==> 32768.0

      jshell>

            Assignee:
            Raffaello Giulietti
            Reporter:
            Jatin Bhateja
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: