MAINT: windows definition for log2

This commit is contained in:
Joe Jevnik
2017-02-07 16:52:53 -05:00
parent d66309a3a0
commit d4c5b560c8
+11 -1
View File
@@ -1,7 +1,7 @@
"""
Factorization algorithms.
"""
from libc.math cimport log2, floor
from libc.math cimport floor
cimport numpy as np
import numpy as np
@@ -10,6 +10,16 @@ from zipline.utils.numpy_utils import unsigned_int_dtype_with_size_in_bytes
np.import_array()
IF UNAME_SYSNAME == "Windows":
# msvc doesn't define log2
from libc.math cimport log
cdef double log2(double d):
return log(d) / log(2);
ELSE:
from libc.math cimport log2
ctypedef fused unsigned_integral:
np.uint8_t
np.uint16_t