PDA

查看完整版本 : Round, With Tie Breakers, Round Three - Cleve Moler on Mathematics and Computing


poster
2021-04-24, 17:42
https://blogs.mathworks.com/wp-content/themes/mathworks_1.0/images/placeholder_9.jpg
I recently published Round, With Ties to Even (https://blogs.mathworks.com/cleve/2021/02/25/round-with-ties-to-even/) and followed that with Round Two (https://blogs.mathworks.com/cleve/2021/03/02/round-with-tie-breakers-round-two/). Then, in an email, Andy Bartlett pointed out that my new round function fails for some large values of x between flintmax/2 and flintmax.

Contentsflintmax/2 (https://www.labfans.com/bbs/admincp/#a671370a-6f40-4104-b479-e697499dbc7b)Rounding (https://www.labfans.com/bbs/admincp/#48e9c6a5-0d15-4441-b6d8-f828215f1bb8)round (https://www.labfans.com/bbs/admincp/#a7268701-3d97-438d-b0b6-deb553b62de6)test (https://www.labfans.com/bbs/admincp/#98e070ea-b963-422b-93c9-4c67d4abb62e)flintmax/2The quantity f = flintmax/2 is equal to 2^52, which is 1/eps. The help entry for format bank says it is a fixed format for dollars and cents. That's true, but I also like to use it for displaying large flints.

format bank f = flintmax/2f = 4503599627370496.00The



...read more >> (https://blogs.mathworks.com/cleve/?p=6792)

http://feeds.feedburner.com/~r/mathworks/moler/~4/-XLQ4nARl1s

More... (http://feedproxy.google.com/~r/mathworks/moler/~3/-XLQ4nARl1s/)