Git Product home page Git Product logo

Comments (3)

gachgp avatar gachgp commented on June 11, 2024

Hi @mpusz,

I made another check and it seems to not work if SI and imperial units are mixed. For SI only units it works. However it seems to convert the hours to seconds although it is not needed, because the output of:

auto length = si::length<si::metre>(10);                                                                       
auto time = si::time<si::hour>(2);
std::cout << length * length * time << '\n';

is

200 [36 × 10²] m²⋅s

--
Cheers,
Grzegorz

from mp-units.

mpusz avatar mpusz commented on June 11, 2024

Hi, thanks for reporting.

Answering your first post, it is a well-known issue (see #55) and we are looking for the best solution to handle it. I have a couple of ideas but need some time to experiment with them and choose the best one.

Regarding the second one, seconds are never converted to hours in this example. The value stored in a quantity is 200 and I think it is what you expect here. Hours are not printed in the unit symbol because it is an unknown dimension with an unknown unit so the only thing that we can print is that its unit is a ratio of 3600 of a coherent unit of this dimension that in this case is m²⋅s.

from mp-units.

oschonrock avatar oschonrock commented on June 11, 2024

Compiles and works after:
834d1fa

from mp-units.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.