Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isinf and isnan doesn't work for Num type #1118

Open
dsryu0822 opened this issue Apr 14, 2024 · 2 comments
Open

isinf and isnan doesn't work for Num type #1118

dsryu0822 opened this issue Apr 14, 2024 · 2 comments

Comments

@dsryu0822
Copy link

issue

isinf

julia> infty = Num(Inf)
Inf

julia> isinf(infty)
false

julia> infty == Inf
true

julia> infty == Num(Inf)
true

isinf dosent' work but at least straight comparision by == is available.

isnan

julia> nana = Num(NaN)
NaN

julia> isnan(nana)
false

julia> nana == NaN
false

julia> nana == Num(NaN)
false

It's worse than Inf. I know that NaN == NaN returns false regardless Num, but I'm stuck in here because there is no alternative.

Enviroment

  • julia v1.10
  • Symbolics v5.28
@dpsanders
Copy link

You can use Symbolics.value(x) to extract the value inside the Num.

@ChrisRackauckas
Copy link
Member

We could overload these two functions though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants