You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These functions were defined before we based our code on C++11 (for std::shared_ptr), among other things. We're generally trying to limit the amount of C++11 we use for simplicity, but we might consider just adopting std::fmin and std::fmax.
However, fmin/fmax support additional float-specific behavior, such as handling of NaN values (only returning the non-NaN value), and some implementations return ±0 properly (std::fmin(+0,-0) may guarantee return of -0, for example).
In our simple implementation, we really just emulate std::min and std::max. It might be better just to rename these functions min and max, relying on specific overloads. image_texture for example could use max(int,int).
Generally, not sure if it's worth the effort to refactor these, but thought I'd write down the considerations here.
hollasch
changed the title
Book one - Functions named ffmin & ffmax but they use doubles
Revisit ffmin/ffmax?
Apr 6, 2020
In Listing 22, I assume the
ff
in functionsffmin
andffmax
stands forfloatfloatmin
andfloatfloatmax
. However, these functions use doubles.The text was updated successfully, but these errors were encountered: