mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 01:38:30 +08:00
MAINT: windows definition for log2
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user