Skip to content

Instantly share code, notes, and snippets.

@srawlins
Created November 17, 2010 20:29
Show Gist options
  • Save srawlins/704017 to your computer and use it in GitHub Desktop.
Save srawlins/704017 to your computer and use it in GitHub Desktop.
bug in GMP gem
ruby-1.9.1-p378 > g_one = GMP::Z(1)
=> 1
ruby-1.9.1-p378 > a = b = GMP::Z(0)
=> 0
ruby-1.9.1-p378 > a += g_one
=> 1
ruby-1.9.1-p378 > a
=> 1
ruby-1.9.1-p378 > b
=> 0
ruby-1.9.1-p378 > c = d = GMP::Z(0)
=> 0
ruby-1.9.1-p378 > GMP::Z.add(c, c, g_one)
=> nil
ruby-1.9.1-p378 > c
=> 1
ruby-1.9.1-p378 > d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment