mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-10 15:44:28 +02:00
fix: hypot
implementation fixed
This commit is contained in:
@@ -273,7 +273,7 @@ template<Quantity Q1, Quantity Q2>
|
||||
{
|
||||
using std::hypot;
|
||||
using type = quantity<common_reference(Q1::reference, Q2::reference), decltype(hypot(x.number(), y.number()))>;
|
||||
return type{hypot(x.number(), y.number())};
|
||||
return type{hypot(type{x}.number(), type{y}.number())};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -291,7 +291,7 @@ template<Quantity Q1, Quantity Q2, Quantity Q3>
|
||||
using std::hypot;
|
||||
using type = quantity<common_reference(Q1::reference, Q2::reference, Q3::reference),
|
||||
decltype(hypot(x.number(), y.number(), z.number()))>;
|
||||
return type{hypot(x.number(), y.number(), z.number())};
|
||||
return type{hypot(type{x}.number(), type{y}.number(), type{z}.number())};
|
||||
}
|
||||
|
||||
} // namespace units
|
||||
|
Reference in New Issue
Block a user