sevanspowell / CardinalCalculator

Stanford iTunes U "Developing iOS 10 Apps with Swift" course project.
0 stars 0 forks source link

CalculatorBrain factorial function hacky #21

Open sevanspowell opened 7 years ago

sevanspowell commented 7 years ago

The CalculatorBrain factorial function currently takes Doubles as arguments and works by truncating the Double to Int.

The calculator should instead not allow Doubles as input.

The factorial function also does not handle overflow/large input numbers.

sevanspowell commented 7 years ago

Maybe return NaN for input with fractional part. Let calculator display handle NaN case and display a message such as "Not a number".