Details

    • Number of attachments :
      0

      Description

      Loaded suite test/externals/ruby_test/test/core/Numeric/instance/tc_to_int
      Started
      ...F
      Finished in 0.094 seconds.
      
        1) Failure:
      test_to_int_twos_complement(TC_Numeric_ToInt_InstanceMethod):1:
      <9223372036854775808> expected but was
      <9223372036854775807>.
      

        Issue Links

          Activity

          Hide
          Marcin Mielzynski added a comment -

          It's not a #truncate issue since that float itself doesn't match MRI.

          puts 9223372036854775808.9223372036854775808

          MRI:
          9.22337203685478e+018

          JRuby:
          9.223372036854776e+18

          Either a parser or a rounding issue.

          Show
          Marcin Mielzynski added a comment - It's not a #truncate issue since that float itself doesn't match MRI. puts 9223372036854775808.9223372036854775808 MRI: 9.22337203685478e+018 JRuby: 9.223372036854776e+18 Either a parser or a rounding issue.
          Hide
          Sammy Larbi added a comment -

          Looks like JRuby takes the double value for RubyFloat and casts it to a long. Java 1.5 exhibits the same behavior:

          public class Scratch {
          public static void main(String args[])

          { double num = 9223372036854775808.9223372036854775808; System.out.println((long)num); }

          }

          Running that program gives the following output:

          9223372036854775807

          Show
          Sammy Larbi added a comment - Looks like JRuby takes the double value for RubyFloat and casts it to a long. Java 1.5 exhibits the same behavior: public class Scratch { public static void main(String args[]) { double num = 9223372036854775808.9223372036854775808; System.out.println((long)num); } } Running that program gives the following output: 9223372036854775807
          Hide
          Vladimir Sizikov added a comment -

          Resolved in rev. r5835 on trunk.

          Show
          Vladimir Sizikov added a comment - Resolved in rev. r5835 on trunk.

            People

            • Assignee:
              Vladimir Sizikov
              Reporter:
              Charles Oliver Nutter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: