move some number util functions from Legacy to Number