You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5262 Reporter: edmcman Assigned to:@xclerc Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z) Resolution: fixed Priority: normal Severity: minor Version: 3.12.0 Fixed in version: 3.12.1+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
Taking a small, positive integer < 2^n and shifting it to the right by n bits should result in 0. When using Big_ints, the resulting value v has the following properties: (string_of_big_int v) = "0" but (eq_big_int v zero_big_int) = false.
See the sample program:
open Big_int
let x = big_int_of_int 12;;
let sign = shift_right_big_int x 31;;
Original bug ID: 5262
Reporter: edmcman
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.0
Fixed in version: 3.12.1+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
Taking a small, positive integer < 2^n and shifting it to the right by n bits should result in 0. When using Big_ints, the resulting value v has the following properties: (string_of_big_int v) = "0" but (eq_big_int v zero_big_int) = false.
See the sample program:
open Big_int
let x = big_int_of_int 12;;
let sign = shift_right_big_int x 31;;
Printf.printf "sign: %s; sign==0: %b\n" (string_of_big_int sign) (eq_big_int sign zero_big_int);;
For me, this program displays: sign: 0; sign==0: false
I expect it to display: sign: 0; sign==0: true
The text was updated successfully, but these errors were encountered: