We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bee0c4e commit 2f6549cCopy full SHA for 2f6549c
kit/kit.h
@@ -1102,6 +1102,24 @@ namespace kit
1102
return -1;
1103
return 0;
1104
}
1105
+ inline float sign(float v)
1106
+ {
1107
+ if(v > 0.0f)
1108
+ return 1.0f;
1109
+ else if(v < 0.0f)
1110
+ return -1.0f;
1111
+ return 0.0f;
1112
+
1113
+ }
1114
+ inline double sign(double v)
1115
1116
+ if(v > 0.0)
1117
+ return 1.0;
1118
+ else if(v < 0.0)
1119
+ return -1.0;
1120
+ return 0.0;
1121
1122
1123
1124
template<class T>
1125
T mix(T a, T b, float t) {
0 commit comments