sercantutar / infint

Arbitrary-Precision Integer Arithmetic
http://sercantutar.github.io/infint/
201 stars 49 forks source link

No override for int * InfInt #11

Open GitBingo opened 7 years ago

GitBingo commented 7 years ago

InfInt numerator = 1; InfInt denominator = 2;

numerator += 2 * denominator;

The above statement crashes, the statement has to read

InfInt numerator = 1; InfInt denominator = 2; InfInt two = 2;

numerator += two * denominator;

melvyniandrag commented 7 years ago

InfInt int is implemented. So denominator 2 works. You could implement the operation as described here: https://stackoverflow.com/questions/1188566/operator-overloading-in-c-as-int-obj