JuliaPhysics / JuliaPhysics/Unitful.jl
Missing `rem` methods
- Dominant language
- Julia
- Stars
- 675
- Forks
- 124
- Avg merge
- 3h 38m
- Merged PRs (30d)
- 1
Description
It is currently not possible to call `rem` when one argument is a unitless number and the other argument is a dimensionless quantity:
```julia
julia> rem(1, 1m/mm)
ERROR: MethodError: no method matching rem(::Int64, ::Quantity{Int64, NoDims, Unitful.FreeUnits{(mm^-1, m), NoDims, nothing}})
[...]
julia> rem(1mm/m, 1)
ERROR: MethodError: no method matching rem(::Quantity{Int64, NoDims, Unitful.FreeUnits{(mm, m^-1), NoDims, nothing}}, ::Int64)
[...]
```
This might also apply to other function (`div` etc.), I didn’t check yet.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the two Julia examples in the issue and inspect Unitful.jl's handling of rem for unitless and dimensionless quantities. Identify related arithmetic functions such as div that may have the same gap. Done means the reported rem calls work and regression tests cover both argument orders, with any additional affected functions addressed or documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100