3 ms·
No wonder people don't like doing floating-point calculations if theres a chance with certain input to have your pow-call fallthrough into a 1000x slower code p
by revelation 12y ago
No wonder people don't like doing floating-point calculations if theres a chance with certain input to have your pow-call fallthrough into a 1000x slower code path.
I mean, that should probably be an option. It's realloc all over, plain unusable because of the rare chance the function goes mad and copies data instead of failing.
- GFK_of_xmaspast 12y agoWhy are you blaming this on ~~~floating point~~~ instead of glibc?
- pascal_cuoq 12y agoDo you have a reference for the claim that realloc() is unusable for the reason you say? Many users of floating-point are not using floating-point in hard real-time contexts. Even soft real-time contexts can be fine with Ziv-style successive approximations. Correctly rounded library functions have intangible benefits beyond precision (portability, for instance), but if you don't value these benefits, you can always use inaccurate and always fast functions. You don't even need to invent your own: just rip off the first stage of a multi-stage Ziv implementation. I don't think any of this is the reason why “people don't like doing floating-point calculations”.