File: _xlogy.pxd

package info (click to toggle)
python-scipy 0.14.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 52,228 kB
  • ctags: 63,719
  • sloc: python: 112,726; fortran: 88,685; cpp: 86,979; ansic: 85,860; makefile: 530; sh: 236
file content (15 lines) | stat: -rw-r--r-- 370 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*-cython-*-

from _complexstuff cimport zlog, npy_log1p, zisnan, number_t

cdef inline number_t xlogy(number_t x, number_t y) nogil:
    if x == 0 and not zisnan(y):
        return 0
    else:
        return x * zlog(y)

cdef inline double xlog1py(double x, double y) nogil:
    if x == 0 and not zisnan(y):
        return 0
    else:
        return x * npy_log1p(y)