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 1 day ago

marcIhm commented 2 days ago

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

marcIhm commented 1 day 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 1 day ago

See above.