DoubleFloats.jl icon indicating copy to clipboard operation
DoubleFloats.jl copied to clipboard

sqrt(NaN)

Open GregPlowman opened this issue 10 months ago • 1 comments

Is this the expected result?

# DoubleFloats v1.3.8
sqrt(zero(Double64) / 0)
ERROR: DomainError with sqrt(x) expects x >= 0:

Differs from earlier version and Float64:

# DoubleFloats v1.3.6
sqrt(zero(Double64) / 0)
NaN
sqrt(zero(Float64) / 0)
NaN

GregPlowman avatar Apr 22 '24 08:04 GregPlowman

hmm

JeffreySarnoff avatar Apr 22 '24 08:04 JeffreySarnoff

Here's a comparision with some other extended precision floating point data types:

using Quadmath
using MultiFloats
using DoubleFloats

f(::Type{T}) where {T} = sqrt(zero(T) / zero(T))

f(Float64)     # NaN
f(BigFloat)    # NaN
f(Float128)    # -nan
f(Float64x2)   # NaN
f(Double64)    # ERROR: DomainError with sqrt(x) expects x >= 0

GregPlowman avatar Jun 17 '24 22:06 GregPlowman

Yes -- I have been involved elsewhere, apologies for the delay.

On Mon, Jun 17, 2024 at 6:22 PM GregPlowman @.***> wrote:

Here's a comparision with some other extended precision floating point data types:

using Quadmath using MultiFloats using DoubleFloats

f(::Type{T}) where {T} = sqrt(zero(T) / zero(T))

f(Float64) # NaN f(BigFloat) # NaN f(Float128) # -nan f(Float64x2) # NaN f(Double64) # ERROR: DomainError with sqrt(x) expects x >= 0

— Reply to this email directly, view it on GitHub https://github.com/JuliaMath/DoubleFloats.jl/issues/201#issuecomment-2174534015, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM2VRWXVY7IJ5QRBTM5ZZTZH5OQVAVCNFSM6AAAAABGSI7FL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZUGUZTIMBRGU . You are receiving this because you commented.Message ID: @.***>

JeffreySarnoff avatar Jun 17 '24 22:06 JeffreySarnoff

I am spending time to get the current nits in DoubleFloats and one or two other packages resolved before JuliaCon. This problem arose with the merging of another PR. I will get it fixed or undo that PR this week.

On Mon, Jun 17, 2024 at 6:34 PM Jeffrey Sarnoff @.***> wrote:

Yes -- I have been involved elsewhere, apologies for the delay.

On Mon, Jun 17, 2024 at 6:22 PM GregPlowman @.***> wrote:

Here's a comparision with some other extended precision floating point data types:

using Quadmath using MultiFloats using DoubleFloats

f(::Type{T}) where {T} = sqrt(zero(T) / zero(T))

f(Float64) # NaN f(BigFloat) # NaN f(Float128) # -nan f(Float64x2) # NaN f(Double64) # ERROR: DomainError with sqrt(x) expects x >= 0

— Reply to this email directly, view it on GitHub https://github.com/JuliaMath/DoubleFloats.jl/issues/201#issuecomment-2174534015, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM2VRWXVY7IJ5QRBTM5ZZTZH5OQVAVCNFSM6AAAAABGSI7FL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZUGUZTIMBRGU . You are receiving this because you commented.Message ID: @.***>

JeffreySarnoff avatar Jun 17 '24 22:06 JeffreySarnoff