JuliaPhysics / JuliaPhysics/Unitful.jl

Inexact conversion for rational powers

Open
#244 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
675
Forks
124
Avg merge
3h 38m
Merged PRs (30d)
1

Description

I just tried
```julia
uconvert(u"m^-1", 1"pl^(-1//3)")
# returns 99999.99999999999 m^-1
uconvert(u"μm^-1",1.0u"1/pl^(1//3)")
# returns 0.09999999999999998 μm^-1
```
and I get these floating point round-off errors.
Would it be possible to get exact values, if we'd define special handling of `cbrt` like there is for `sqrt`?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the uconvert handling for rational powers and compare its treatment of cbrt with the existing special handling for sqrt. Confirm the behavior with the two Julia examples in the issue; done means the conversions return exact values rather than floating-point round-off results.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.