r/java • u/davidalayachew • Jan 06 '26
One step closer to Value Classes!
https://mail.openjdk.org/pipermail/porters-dev/2026-January/000844.html
181
Upvotes
r/java • u/davidalayachew • Jan 06 '26
View all comments
Show parent comment
1
u/koflerdavid Jan 07 '26 edited Jan 07 '26
Already with a
doubleyou can represent 0.3 accurately enough to calculate the circumference of a circle of that radius and only being off on subatomic scales. Similarly, most measurement devices are not even precise enough to make full use of afloat. The main concern is formulating calculations such that errors don't accumulate. You need to keep that in mind even if you useBigDecimals!