Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export denominator! and numerator! (#1959)
Also allow passing pointers into `numerator!`, and change both to not use `ccall`. This makes it a little bit faster. Before: julia> using Nemo; z = ZZRingElem(); a = QQFieldElem(2, 3); julia> @Btime Nemo.numerator!($z, $a); 5.208 ns (0 allocations: 0 bytes) julia> @Btime Nemo.denominator!($z, $a); 5.166 ns (0 allocations: 0 bytes) julia> a = a^100; julia> @Btime Nemo.numerator!($z, $a); 7.083 ns (0 allocations: 0 bytes) julia> @Btime Nemo.denominator!($z, $a); 6.750 ns (0 allocations: 0 bytes) After: julia> using Nemo; z = ZZRingElem(); a = QQFieldElem(2, 3); julia> @Btime numerator!($z, $a); 4.000 ns (0 allocations: 0 bytes) julia> @Btime denominator!($z, $a); 4.000 ns (0 allocations: 0 bytes) julia> a = a^100; julia> @Btime numerator!($z, $a); 5.875 ns (0 allocations: 0 bytes) julia> @Btime denominator!($z, $a); 5.625 ns (0 allocations: 0 bytes)
- Loading branch information