Skip to content

Comments

Pipe ceil, trunc and floor through round#200

Open
lgoettgens wants to merge 1 commit intoJuliaMath:masterfrom
lgoettgens:lg/invalidations-trunc-ceil-floor
Open

Pipe ceil, trunc and floor through round#200
lgoettgens wants to merge 1 commit intoJuliaMath:masterfrom
lgoettgens:lg/invalidations-trunc-ceil-floor

Conversation

@lgoettgens
Copy link
Contributor

similar to how it is done in julia Base. Also make use of the generic methods from Base where possible, to avoid invalidations.
This PR reduces the number of invalidations of loading DecFP from 517 to 437 (on julia 1.12.5). In particular, the following invalidation trees get resolved:

 inserting floor(::Type{Int64}, x::Dec128) @ DecFP ~/code/julia/DecFP.jl/src/DecFP.jl:552 invalidated:
   backedges: 1: superseding floor(::Type{T}, x) where T @ Base rounding.jl:475 with MethodInstance for floor(::Type{Int64}, ::Any) (3 children)

 inserting ceil(::Type{Int64}, x::Dec128) @ DecFP ~/code/julia/DecFP.jl/src/DecFP.jl:553 invalidated:
   backedges: 1: superseding ceil(::Type{T}, x) where T @ Base rounding.jl:476 with MethodInstance for ceil(::Type{Int64}, ::Any) (30 children)

 inserting ceil(::Type{I}, x::DecFP.DecimalFloatingPoint) where I<:Integer @ DecFP ~/code/julia/DecFP.jl/src/DecFP.jl:576 invalidated:
   backedges: 1: superseding ceil(::Type{T}, x) where T @ Base rounding.jl:476 with MethodInstance for ceil(::Type{Integer}, ::Any) (59 children)

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.00%. Comparing base (a572ebd) to head (dae0967).

Files with missing lines Patch % Lines
src/DecFP.jl 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #200      +/-   ##
==========================================
- Coverage   96.12%   94.00%   -2.12%     
==========================================
  Files           2        2              
  Lines         593      584       -9     
==========================================
- Hits          570      549      -21     
- Misses         23       35      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

1 participant