Skip to content

Commit

Permalink
Fix of_string for words
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Feb 9, 2021
1 parent a0c9fd7 commit 095b32d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mo_values/numerics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ struct
let of_int = WordRep.of_int_u
let to_int w = Big_int.int_of_big_int (WordRep.to_big_int w)

let of_string s =
of_big_int (Big_int.big_int_of_string (String.concat "" (String.split_on_char '_' s)))

let base = of_int_u 16
let digs =
[|"0"; "1"; "2"; "3"; "4"; "5"; "6"; "7";
Expand Down

0 comments on commit 095b32d

Please sign in to comment.