-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Description
While being able to round in a unit-controlled way is neat (and should perhaps be encouraged n the docs), what's the reason to disallow simple rounding? I expected the second of these to work, and if it did, then code with & without units would behave the same:
len = (120//1)u"cm"
round(u"m", len, sigdigits=2)
tim = 3.0000001u"s"
round(tim, sigdigits=3) # ERROR: specify the type of the quantity to convert to when roundingEdit: for sigdigits in particular, the objection that the rounding depends on your units does not apply, these agree:
tim_ns = tim |> u"ns"
round(ustrip(tim), sigdigits=3) * unit(tim)
round(ustrip(tim_ns), sigdigits=3) * unit(tim_ns)rafaqz, KronosTheLate, Shinobi-mechatro, acpetit and PatrickHaeckersostock and cstjean
Metadata
Metadata
Assignees
Labels
No labels