Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005262OCamlOCaml generalpublic2011-05-06 21:462012-09-25 20:06
Reporteredmcman 
Assigned Toxclerc 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.0 
Target VersionFixed in Version3.12.1+dev 
Summary0005262: Big_int shifting and eq_big_int problems
DescriptionTaking 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
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-05-06 21:46 edmcman New Issue
2011-05-12 11:00 xclerc Status new => resolved
2011-05-12 11:00 xclerc Fixed in Version => 3.12.1+dev
2011-05-12 11:00 xclerc Resolution open => no change required
2011-05-12 11:00 xclerc Assigned To => xclerc
2011-05-12 17:18 xleroy Resolution no change required => fixed
2012-09-25 20:06 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker