Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8046060

Different results of floating point multiplication for lambda code block

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 8u40
    • Component/s: tools
    • Labels:
    • Environment:

      JDK 9 b15 x86

    • Subcomponent:
    • Resolved In Build:
      b01
    • CPU:
      x86
    • OS:
      windows_7

      Backports

        Description

        The result of execution of floating point expression invoked in the lambda code block is different:

        2.1552676198089365E-308
        2.155267619808936E-308

        strictfp
        public class type04404 {

            public static void main(String args[]) {
                clone(() -> {
                    double x = Double.longBitsToDouble(0x1e7ee00000000000L);
                    double y = Double.longBitsToDouble(0x2180101010101010L);

                    double z = x * y;
                    System.out.println(z);
                });
                {
                    double x = Double.longBitsToDouble(0x1e7ee00000000000L);
                    double y = Double.longBitsToDouble(0x2180101010101010L);

                    double z = x * y;
                    System.out.println(z);
                }
            }
         
            private static void clone(Face arg) {
                arg.run();
            }

            private interface Face {
                void run();
            }
        }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                rfield Robert Field
                Reporter:
                ogb Oleg Barbashov (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: