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
{{ message }}
This repository has been archived by the owner on May 16, 2019. It is now read-only.
In C++ the order of evaluation is unspecified. That's why most of implementations here cause an undifined behavior, working correctly only sometimes or only with choosen compilers. For instance:
C++ standard doesn't specify if t/=d will be evaluated before t*t*tor after, or in between.... That can lead to different results on different compilers/operating systems etc.
This code, and all others, should be rewritten as:
float Quart::easeIn (float t,float b , float c, float d) {
t /= d;
return c*t*t*t*t + b;
}
In C++ there is no performance gain in writing such one-liners, even if they don't cause undefined behavior.
The text was updated successfully, but these errors were encountered:
Hey thanks! Unfortunately I don't use openframeworks much these days so won't be able to fix myself in the foreseeable future. If you get to forking / fixing send me a pull request and I'll happily merge in. Cheers,
j
This code has only <math.h> dependency so it's pure C++ not bound to openframeworks at all (and that's a good thing for sure)! I will fix it in few days I guess.
In C++ the order of evaluation is unspecified. That's why most of implementations here cause an undifined behavior, working correctly only sometimes or only with choosen compilers. For instance:
C++ standard doesn't specify if
t/=d
will be evaluated beforet*t*t
or after, or in between.... That can lead to different results on different compilers/operating systems etc.This code, and all others, should be rewritten as:
In C++ there is no performance gain in writing such one-liners, even if they don't cause undefined behavior.
The text was updated successfully, but these errors were encountered: