Skip to content

Inconsistent type conversions for trigonometric functions #626

Description

@dionhaefner

Example:

>>> import numpy as np

>>> np.arctanh(np.array([0], dtype='int8')).dtype
dtype('float16')

>>> np.arctanh(np.array([0], dtype='int16')).dtype
dtype('float32')

>>> np.arctanh(np.array([0], dtype='int32')).dtype
dtype('float64')

vs.

>>> import bohrium as bh

>>> bh.arctanh(bh.array([0], dtype='int8')).dtype
dtype('float32')

>>> bh.arctanh(bh.array([0], dtype='int16')).dtype
dtype('float32')

>>> bh.arctanh(bh.array([0], dtype='int32')).dtype
dtype('float32')

Functions showing this behavior:

[
    'sin',
    'cos',
    'tan',
    'sinh',
    'cosh',
    'tanh',
    'arcsin',
    'arccos',
    'arctan',
    'arcsinh',
    'arccosh',
    'arctanh'
]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions