4 ms·
Maybe because the need for them has popped up enough times and they tought it would be a good idea to add them to the standard? Also that addition wouldn't hurt
by lobo_tuerto 11y ago
Maybe because the need for them has popped up enough times and they tought it would be a good idea to add them to the standard? Also that addition wouldn't hurt no one.
- jordigh 11y ago> Also that addition wouldn't hurt no one. Library implementors would have to implement it. Most of them are probably unqualified to do it, so they'll probably just grab Boost's implementation. And Boost's implementation would be unreadable to most implementors. Thus everyone would get a slightly subpar implementation, because most numerical researchers are not keeping an eye on Boost and making sure it has the best methods available. The end result is that those in the know will avoid the C++ stdlib, just like Qt did and reimplemented strings and maps. We've seen this problem before with valarray and with export. There is a problem with standardising something that nobody wants or nobody can implement correctly.
- Someone 11y agoThe flip side is that I would rather use a “slightly subpar” implementation than having to roll my own from a Google search and some smart guessing. For example, if you want to implement a Student's t-test, you soon will run into the problem that you want to have a Beta function or the gamma function. One could probably copy-paste a somewhat working version together from search engines, add asserts to prevent me from ever calling them with arguments out of the range where it seems to work, but for most of us, the result likely will be slower and less precise than a version that gcc, clang, or commercial compilers would provide. And yes, I could probably buy an implementation somewhere, but in the real world, that often isn’t a real option, and even then, I wouldn’t know how well it worked, either.
- GFK_of_xmaspast 11y agoWouldn't it be pretty easy to compare a re-implementation of a special function against a reference boost implementation? For example, there are only 232 floats and for a given function you can check them all very quickly. It's a little trickier for doubles, but one can imagine doing, say, 240 tests and getting a reasonable level of confidence.