marcIhm / yabasic

Yabasic - A simple Basic interpreter for Unix and Windows
http://www.yabasic.de
MIT License
90 stars 17 forks source link

Function round should accept an optional parameter for precision #62

Closed marcIhm closed 2 weeks ago

marcIhm commented 3 weeks ago

currently round(2.5) returns 2; in addition round(2.449, 2) should return 2.45

marcIhm commented 2 weeks ago

On second thought, this is not the way to go; round is only exact for integers but not for fractional numbers. Limiting precision should be the very last step on output.

marcIhm commented 2 weeks ago

See above.