http://qs1969.pair.com?node_id=1168529


in reply to Re: Variables are automatically rounded off in perl
in thread Variables are automatically rounded off in perl

TLDR: It's not just perl. It's (virtually) every computer language out there."

Exactly. JavaScript works the same way. I usually avoid working with floats whenever possible. If I have to get a precise result, then I multiply my number by 1000 to push the decimal point to the right. Whatever comes after the decimal point gets rounded, and it's usually garbage.