kasparsklavins / bigint

A lightweight big integer library for c++
MIT License
220 stars 55 forks source link

Not correct string number #34

Open tigertv opened 4 years ago

tigertv commented 4 years ago
Bigint a("m");

The following code gives a loop.

kasparsklavins commented 4 years ago

Runnable example

"m" isnt a valid argument. What output do you expect?

Can either:

  1. Throw
  2. Cast to 0

I'm leaning mostly towards (1)

tigertv commented 4 years ago

Exception, not a loop.

Qix- commented 2 years ago

Throwing makes the most sense, or in the case that -fno-exceptions is on, then std::abort() and document that invalid input is simply not tolerated.