Commits

arkdro  committed 4fd1016

adding convertion big_int to large_big chars

  • Participants
  • Parent commits 0939fab

Comments (0)

Files changed (1)

File lib/ocamerl/ocamerl/tools.ml

   in
   f [] 0 positive
 
+let large_big_chars_of_big_int num =
+  small_big_chars_of_big_int num        (* temp stub *)
+
 let chars_of_big_int num =
-  small_big_chars_of_big_int num
+  (* TODO: measure performance, make it constant *)
+  let max = Big_int.shift_left_big_int Big_int.unit_big_int (8*256) in
+  if Big_int.lt_big_int num max
+  then small_big_chars_of_big_int num
+  else large_big_chars_of_big_int num
 
 let rec _chars_of_int v chars n =
     match n > 0 with