bernedom / SI

A header only C++ library that provides type safety and user defined literals for physical units
https://si.dominikberner.ch/doc/
MIT License
486 stars 40 forks source link

beginner question - how to multiply by a unitless quantity #130

Open RallyTronics opened 9 months ago

RallyTronics commented 9 months ago

How do I multiply an SI unit by a unitless quantity i.e

struct sphere_t
{
    SI::metre_t<double> r;

    SI::square_metre_t<double> surface_area(void) const
    {
        return 4.0 * PI * r * r;
    }
};