What to do with Java BigDecimal performance?

后端 未结 20 2532
陌清茗
陌清茗 2020-11-29 17:28

I write currency trading applications for living, so I have to work with monetary values (it\'s a shame that Java still doesn\'t have decimal float type and has nothing to s

20条回答
  •  醉话见心
    2020-11-29 18:13

    You might want to move to fixed point math. Just searching for some libraries right now. on sourceforge fixed-point I haven't looked at this in depth yet. beartonics

    Did you test with org.jscience.economics.money? since that has assured accuracy. The fixed point will only be as accurate as the # of bits assigned to each piece, but is fast.

提交回复
热议问题