Skip to content

exp() of Complex{BFloat16} get infinite recursion #120

Description

@Centauria

exp() of Complex{BFloat16} gets error

julia> exp(Complex{BFloat16}(0.0, 1.0))
Warning: detected a stack overflow; program state may be corrupted, so further execution might be unreliable.
ERROR: StackOverflowError:
Stacktrace:
     [1] sincos(x::BFloat16)
       @ Base.Math .\special\trig.jl:208
     [2] _sincos(x::BFloat16)
       @ Base.Math .\special\trig.jl:205
--- the above 2 lines are repeated 39990 more times ---
 [79983] sincos(x::BFloat16)
       @ Base.Math .\special\trig.jl:208

I made a patch and it works

Base.Math.sincos(x::BFloat16) = BFloat16.(sincos(Float32(x)))

but it's surely not the best approach.

Hope fixing.

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