Open karlphillip opened 6 years ago
The function bool can_convert_to_int(int *result)
converts a Num
to int, but only if it would fit.
I also thought about overloading cast to int, but it seemed too unsafe. I wanted to discourage conversion where it is not possible.
Documentation could certainly be improved.
I understand
Num
can store really big integers. However, sometimes it can store a small number. In this scenario, what would be the best way to convertNum
to a regularint
?