> A C compiler would optimize this to a right shift. Changing that to 
> 'Int64.shift_right n 1' speeds
> up the code.

Sorry to be a pedant, but this is not correct. The optimisation is only 
possible when the arguments
are unsigned integers which I don't think is specifiable when working in OCAML

# Int64.shift_right (-2L) 1;;
- : int64 = -1L (So far, so good)
# Int64.div (-1L) 2L;;
- : int64 = 0L (Good)
# Int64.shift_right (-1L) 1;;
- : int64 = -1L (Duh)


_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to