Re: Phix 1.0.2 uploaded

new topic     » goto parent     » topic index » view thread      » older message » newer message

Of course you can do anything you like with the numbers before passing them to printf(), but
there is no way, or any resemblance of sanity, in disabling rounding within printf() itself.

Suppose I have calculated the price of an item, as 1.8+0.1. Printing that as "1.90" is at
least 100,000,000,000,000 times more accurate/closer to reality than "1.89" would be.

By far the easiest and best way to get/display any rounding (etc) error would be 1.9 - (1.8+0.1).
Note that any error is just as likely to be in the 1.9 as it is the (1.8+0.1).

Phix blows my mind too. What's 10-((10/3)*3)? Answer: 0, and not "nearly 0", but actual 0. Erm...

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu