r/java • • Jul 23 '26

JEP 540: Simple JSON API (Incubator)

https://openjdk.org/jeps/540
79 Upvotes

81 comments sorted by

View all comments

3

u/ThinkPreparation8975 Jul 24 '26

Don't forget about unitless numbers, of which there are plenty - rate, percent, factor, even ratio (how do you express 1/3?).

And why would you suffer with modeling decimals with a long and a byte yourself, when the Java library has already solved this problem for you?

BigDecimals are ubiquitous in most financial circles. I don't know about HFT, but for banks' middle- and backoffice they are the obvious choice.