Skip to content

BUG: scipy.special.sindg returns 0.0 for large argument #20723

Description

@fancidev

Describe your issue.

scipy.special.sindg(x) computes the sine of x where x is measured in degree. It returns 0.0 when x > 1e14.

From the source code it appears this behavior is expected. However, when I use Jupyter Notebook I didn’t get an error or warning message and the function “silently” returned zero.

Though the large argument is probably not so commonly used in practice, it may still be desirable to support it if possible. (One possibility is to provide a function that converts degree to radian and reduce it into [-pi,pi] in one step.)

Reproducing Code Example

import scipy.special
print(scipy.special.sindg(2e14))

# prints 0.0
# expects sindg(2e14 % 360) = sindg(200) = -0.34

Error message

No error is displayed

SciPy/NumPy/Python version and system information

SciPy 1.12 / Python 3.10 / Windows, though I think the issue is platform independent and also exists in HEAD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    defectA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.special

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions