3 ms·
Maybe I am wrong, but is the author just looking for a decimal type? Those exist in most major languages, right?
by shawnhermans 12y ago
Maybe I am wrong, but is the author just looking for a decimal type? Those exist in most major languages, right?
- wolf550e 12y agoThe performance of decimal arithmetic on hardware not recently made by IBM means it cannot be used in most places.
- maxlybbert 12y agoThe original post said he'd be happy to trade performance for consistency. He could also use fdlibm ( http://netlib.org/fdlibm/index.html http://netlib.org/fdlibm/index.html ), at least for anything other than primitive operations. But, again, it trades performance for consistency.
- maxlybbert 12y agoThis week I learned that C99 and C11 have an FP_CONTRACT pragma, that can be set "off" for this reason ( http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf , section 6.5, paragraph 8).
- TheLoneWolfling 12y agoDecimal types suffer from many of the same issues. Sure, 0.1 can be represented exactly. But that's about the only issue with floating-point that that solves.