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

Different results of floating point multiplication for lambda code block

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8u40
    • 9
    • tools
    • JDK 9 b15 x86

    • b01
    • x86
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved: