Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005123OCamlOCaml generalpublic2010-08-09 13:462010-08-18 15:22
Reporterprofjim 
Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.0 
Target VersionFixed in Version3.12.1+dev 
Summary0005123: Big_int.shift_right* methods never yield zero_big_int
Description# compare Big_int.(shift_right_big_int (big_int_of_int 1) 1) (Big_int.zero_big_int);;
- : int = 1

This is because the shift_right methods just copy over the sign of the first argument, without checking whether the value has gone to zero. However:

# compare Big_int.(add_big_int (shift_right_big_int (big_int_of_int 1) 1) zero_big_int) (Big_int.zero_big_int);;
- : int = 0
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005635)
profjim (reporter)
2010-08-09 13:48
edited on: 2010-08-09 13:50

Using Big_int.compare_big_int instead of Pervasives.compare also fails:

# Big_int.compare_big_int (Big_int.shift_right_big_int (Big_int.big_int_of_int 1) 1) (Big_int.zero_big_int);;
- : int = 1

(0005639)
doligez (administrator)
2010-08-18 15:22

Thanks for the report. This will be fixed in 3.12.1.

- Issue History
Date Modified Username Field Change
2010-08-09 13:46 profjim New Issue
2010-08-09 13:48 profjim Note Added: 0005635
2010-08-09 13:50 profjim Note Edited: 0005635
2010-08-18 15:22 doligez Note Added: 0005639
2010-08-18 15:22 doligez Status new => closed
2010-08-18 15:22 doligez Resolution open => fixed
2010-08-18 15:22 doligez Fixed in Version => 3.12.1+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker