Skip to content

Commit

Permalink
feat(vm): Add from_str_radix to std.int
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Apr 16, 2018
1 parent 3a63c26 commit 7d0f705
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vm/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ pub fn load_int(vm: &Thread) -> Result<ExternModule> {
record! {
min_value => std::int::prim::min_value(),
max_value => std::int::prim::max_value(),
from_str_radix => named_primitive!(
2,
"std.int.prim.from_str_radix",
|src, radix| std::int::prim::from_str_radix(src, radix).map_err(|_| ())
),
count_ones => primitive!(1 std::int::prim::count_ones),
count_zeros => primitive!(1 std::int::prim::count_zeros),
leading_zeros => primitive!(1 std::int::prim::leading_zeros),
Expand Down

0 comments on commit 7d0f705

Please sign in to comment.