What to do with Java BigDecimal performance?

后端 未结 20 2529
陌清茗
陌清茗 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:10

    May be you should start with replacing a = (1/b) * c with a = c/b ? It's not 10x, but still something.

    If I were you, I'd create my own class Money, which would keep long dollars and long cents, and do math in it.

提交回复
热议问题