Michael Landis
1 min readDec 24, 2019

--

The answer to plus/minus is incorrect. The fact that the question says “exactly" should tip you off that simple floating point division won’t work. For 5 places, you need to do something like multiply the answer by 100,000, round the result, then use strings to put the decimal in the right place.

--

--

Michael Landis
Michael Landis

Written by Michael Landis

Front-end web developer, React enthusiast, vagabond.

No responses yet