Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open Netsys
- open Printf
- let show s = print_string (s^"\n")
- let to4 x = Netnumber.uint4_of_int x
- let toi x = Netnumber.int_of_uint4 x
- let test a b =
- printf "%i <? %i\n" a b;
- printf "as int : %b\n" (a < b);
- printf "as uint4 : %b\n" (Netnumber.lt_uint4 (to4 a) (to4 b));
- printf "\n"
- let () =
- (*ignore (Netsys.string_of_sockaddr (Obj.magic 0));*)
- test 3422617600 4294967287; (* >> 2^31 * 2 *)
- test 2147483647 4294967287; (* 2^31-1, >> 2^31 *)
- test 2147483648 2147483649; (* 2^31, 2^31+1 *)
- test 2147483648 4294967295 (* 2 ^ 31, 2^32-1 *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement