JuliaPhysics / JuliaPhysics/Unitful.jl

Conversion fails to strip variable

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

Description

Running this snippet
```
using PhysicalConstants.CODATA2018: c_0

index = 1.858
c::Float64 = c_0 / index
```
raises

```ERROR: DimensionError: and m s^-1 are not dimensionally compatible.```

It is my understanding that this comes from the fact that ```Float64(c_0)``` returns a ```Unitful.Quantity{Float64, 𝐋 𝐓 ^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓 ^-1, nothing}}``` instead of a Float64.

I don't think this should be the expected behavior and in such a case the variable should be stripped of its unit.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.