I've defined my max_t for directional lights as infinity using the limits library and the technique described in the assignment description, but when I compare it to a double it's always returning true. I think gcc with the version of c++ I'm using has has trouble with this.
I've found a way that works which is to check if it's infinity by comparing it to DBL_MAX which is defined in float.h.
My question is, can we #include "float.h" in our code?
I've defined my max_t for directional lights as infinity using the limits library and the technique described in the assignment description, but when I compare it to a double it's always returning true. I think gcc with the version of c++ I'm using has has trouble with this.
I've found a way that works which is to check if it's infinity by comparing it to DBL_MAX which is defined in float.h.
My question is, can we #include "float.h" in our code?