Generic frexp#150
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #150 +/- ##
==========================================
+ Coverage 48.75% 48.87% +0.11%
==========================================
Files 63 63
Lines 3425 3429 +4
==========================================
+ Hits 1670 1676 +6
+ Misses 1755 1753 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
seems reasonable -- it is breaking though. thoughts? |
|
I guess it's your call whether to call it a bugfix :) No rush from me, certainly not worth 2.0. You would have to depend on this package to be relying on the old behaviour. None of the direct packages in General seem to. What people do in private I don't know. From Juliahub, list of deps: Packages which do use or define https://github.com/StevenWhitaker/BlochSim.jl/blob/f5a353867c2b08c2e40b6737e97586dad8882581/src/expm.jl#L200-L212 https://github.com/JuliaPhysics/Measurements.jl/blob/b26fbff340f6a9c1432a06c8941ff9ba9a0ca34f/src/math.jl#L580-L583 https://github.com/PainterQubits/Unitful.jl/blob/960e09ef518b0d3ff54747460b9c3872c08df0d7/src/quantities.jl#L467-L470 |
| Applies `Base.frexp` to both `hi` and `lo` parts, and returns a tuple of tuples. | ||
| See also `DoubleFloats.ldexps` for the inverse, and `DoubleFloats.signs` similar tuple. | ||
| """ | ||
| function frexps(x::DoubleFloat{T}) where {T<:IEEEFloat} |
There was a problem hiding this comment.
This is a bit of an awful name, trying to match signs. Could be more explicit like double_frexp or something.
|
It would be great if you could merge this PR, I just had a bug because significand(x::DoubleFloat{T}) where {T<:IEEEFloat} = frexp(x)[1] * 2
function exponent(x::DoubleFloat{T}) where {T<:IEEEFloat}
!isfinite(x) && throw(DomainError("Cannot be NaN or Inf."))
iszero(x) && throw(DomainError("Cannot be ±0.0."))
return frexp(x)[2] - 1
endand everything would work as expected. IMHO this is a bugfix, and bugfixes are never breaking. |
|
This seems like a reasonable change to me. |
|
done |
|
Thank you, done.
…On Fri, Jan 23, 2026 at 5:34 PM Oscar Smith ***@***.***> wrote:
*oscardssmith* left a comment (JuliaMath/DoubleFloats.jl#150)
<#150 (comment)>
This seems like a reasonable change to me.
—
Reply to this email directly, view it on GitHub
<#150 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM2VRWPSMWM3SWVEEWLD2L4IKOWDAVCNFSM6AAAAAB34G6LISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOOJSHA3DOOBYGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Implements roughly this idea: #148 (comment)