changed C ptr -> Ruby num conversion method