News for hackers. Stuff that matters.
Re:Kotlin Money by atemerev on Tuesday October 08, 2024 @09:27AM (#41777139)
Cool! As underlying values, do you use integers, bigdecimals, or a decimalized double hack like in OpenHFT?
Re:Kotlin Money by eriksencosta on Tuesday October 08, 2024 @09:32AM (#41777198)
It uses BigDecimal. My first goal with the library was to provide a well-designed API. So to keep it simple for myself, I relied on BigDecimal for the calculations.
Re:Kotlin Money by atemerev on Tuesday October 08, 2024 @09:45AM (#41777315)
I think you are right, API is the most important part; internal implementation can be optimized later.
Re:Kotlin Money by vamega on Tuesday October 08, 2024 @01:03PM (#41779436)
What is the double hack used in OpenHFT? I tried looking this up and came up short.
Re:Kotlin Money by pcl on Tuesday October 08, 2024 @06:03PM (#41782251)
I’ll byte. Perhaps you didn’t look long enough. I’m sure the answer will float by at some point.
Re:Kotlin Money by atemerev on Wednesday October 09, 2024 @04:08AM (#41785597)
https://github.com/OpenHFT/Chronicle-Core/blob/ea/src/main/j...

(see roundN)

Be careful and use it only if you know what you are doing and understand the limitations.