Skip to content

Instantly share code, notes, and snippets.

@Watson1978
Created May 3, 2012 06:15
Show Gist options
  • Select an option

  • Save Watson1978/2583693 to your computer and use it in GitHub Desktop.

Select an option

Save Watson1978/2583693 to your computer and use it in GitHub Desktop.
MacRuby : bug : multiply
a = 2147483648
b = 2147483647
p a * b #=> 4611686016279904256
p (-a) * b #=> -4611686016279904256
p a * (-b) #=> -4611686016279904256
p (-a) * (-b) #=> 4611686016279904256
@Watson1978

Copy link
Copy Markdown
Author

Expect

$ ruby19 test_mult.rb                                   
4611686016279904256
-4611686016279904256
-4611686016279904256
4611686016279904256

Result

$ macruby test_mult.rb
4611686016279904256
2147483648
-4611686016279904256
-2147483648

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment