We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c89dfa commit 2827ac3Copy full SHA for 2827ac3
pandas/src/sparse.pyx
@@ -987,10 +987,12 @@ cdef inline float64_t __rsub(float64_t a, float64_t b):
987
988
cdef inline float64_t __div(float64_t a, float64_t b):
989
if b == 0:
990
- if a >= 0:
+ if a > 0:
991
return INF
992
- else:
+ elif a < 0:
993
return -INF
994
+ else:
995
+ return NaN
996
else:
997
return a / b
998
@@ -999,10 +1001,12 @@ cdef inline float64_t __rdiv(float64_t a, float64_t b):
999
1001
1000
1002
cdef inline float64_t __floordiv(float64_t a, float64_t b):
1003
1004
1005
1006
1007
1008
1009
1010
1011
return a // b
1012
0 commit comments