Closed tgross35 closed 2 weeks ago
@beetrees I'm still working on some better naming cleanup / docs / comments, but you may want to take a look at this. Basically migrating from always relying on macro expansion to putting everything into a trait, which should help avoid string matching problems (like you pointed out on a different PR).
None of the possible refactoring of ULP / precision is done here.
Let me know if you have any name suggestions too. I feel like too much here is some variation of "function" or "op", but I can't come up with anything much better.
I still don't have great names but I added the following to hopefully disambiguate a bit https://github.com/rust-lang/libm/blob/7c418306c90bf0180249b3f38761e416cfee86a9/crates/libm-test/src/op.rs#L6-L14
I think the naming here is always going to be somewhat arbitrary, but I think what you've gone with is perfectly reasonable terminology (I don't have any unequivocally better ideas). The most important thing (which I can see you have done) is to make sure it's documented.
This allows us to move a lot of logic out of macros and into generic functions, which is a nice cleanup and much better for usability.