示例#1
0
import math
from numba import types, utils
from numba.typing.templates import (AttributeTemplate, ConcreteTemplate,
                                    signature, Registry)

registry = Registry()
infer_global = registry.register_global


@infer_global(math.exp)
@infer_global(math.expm1)
@infer_global(math.fabs)
@infer_global(math.sqrt)
@infer_global(math.log)
@infer_global(math.log1p)
@infer_global(math.log10)
@infer_global(math.sin)
@infer_global(math.cos)
@infer_global(math.tan)
@infer_global(math.sinh)
@infer_global(math.cosh)
@infer_global(math.tanh)
@infer_global(math.asin)
@infer_global(math.acos)
@infer_global(math.atan)
@infer_global(math.asinh)
@infer_global(math.acosh)
@infer_global(math.atanh)
@infer_global(math.degrees)
@infer_global(math.radians)
@infer_global(math.erf)
示例#2
0
import math
from numba import types, utils
from numba.typing.templates import (AttributeTemplate, ConcreteTemplate,
                                    signature, Registry)

registry = Registry()
builtin_global = registry.register_global


@registry.resolves_global(math.exp)
@registry.resolves_global(math.fabs)
@registry.resolves_global(math.sqrt)
@registry.resolves_global(math.log)
@registry.resolves_global(math.log1p)
@registry.resolves_global(math.log10)
@registry.resolves_global(math.sin)
@registry.resolves_global(math.cos)
@registry.resolves_global(math.tan)
@registry.resolves_global(math.sinh)
@registry.resolves_global(math.cosh)
@registry.resolves_global(math.tanh)
@registry.resolves_global(math.asin)
@registry.resolves_global(math.acos)
@registry.resolves_global(math.atan)
@registry.resolves_global(math.asinh)
@registry.resolves_global(math.acosh)
@registry.resolves_global(math.atanh)
@registry.resolves_global(math.degrees)
@registry.resolves_global(math.radians)
class Math_unary(ConcreteTemplate):
    cases = [