3 ms·
You _can_ use floating point if you are very careful and know what you are doing and know about decimal normalization (see e.g. OpenHFT implementation for high-
by atemerev 3y ago
You _can_ use floating point if you are very careful and know what you are doing and know about decimal normalization (see e.g. OpenHFT implementation for high-frequency trading: https://github.com/OpenHFT/Chronicle-Core/blob/ea/src/main/java/net/openhft/chronicle/core/Maths.java https://github.com/OpenHFT/Chronicle-Core/blob/ea/src/main/j...)
But if you are not an expert, you better stick to BigDecimal and absorb the performance costs.
- rvnx 3y agoNice share! Interesting sorcery in their code: > final double residual = df - ldf + Math.ulp(d) * (factor * 0.983);