|
|
|
|
|
by virtualritz
996 days ago
|
|
> Using doubles for crypto prices instead of fixed point seems like a disaster waiting to happen? TDLR; nope. That depends what you use the incoming data for. Bookkeeping, yeah. And that's about it. This doesn't look like it was meant for that. Some sort of trading where you track a bunch of indicators over a day (not HFT at their timings at the moment but along those lines): you absolutely want to avoid fixed point because of the speed penalty. See also [1]. [1] https://news.ycombinator.com/item?id=15808316 |
|
With a caveat here, after a very quick look at the code: The price here is defined as long double, which can be different among platforms... My Mac/clang says that long double is still 8 bytes, Linux on that same arm64 machine says it's 16 bytes (and I'm not sure what that's mapped to these days - 80bit FPU instructions, or some Float128 representation)