MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / Pow

Function Pow

include/LightGBM/utils/common.h:166–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164
165template<typename T>
166inline static double Pow(T base, int power) {
167 if (power < 0) {
168 return 1.0 / Pow(base, -power);
169 } else if (power == 0) {
170 return 1;
171 } else if (power % 2 == 0) {
172 return Pow(base*base, power / 2);
173 } else if (power % 3 == 0) {
174 return Pow(base*base*base, power / 3);
175 } else {
176 return base * Pow(base, power - 1);
177 }
178}
179
180inline static const char* Atof(const char* p, double* out) {
181 int frac;

Callers 1

AtofFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected