tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: 'lround' is not a member of 'std'



On Sat, Jun 08, 2024 at 17:37:35 +0200, Thomas Klausner wrote:

> On Sat, Jun 08, 2024 at 05:28:34PM +0200, Martin Husemann wrote:
>
> > [/tmp] martin@martins > cat test.cc 
> > #include <cmath>
> > 
> > int main(int argc, char **argv)
> > {
> > 	long double v = 1.7;
> > 	auto a = std::lround(v);
> > 	return a;
> > }
> 
> Thanks. But it doesn't when I remove the 'cmath' include. I'll test
> adding that for mame.

https://en.cppreference.com/w/cpp/numeric/math/round (too lazy to find
the actual standard text) says "Defined in header <cmath>".  Include
hygiene issues (i.e. something else pulls in <cmath> on the system
that their build succeeds (accidentally))?

-uwe


Home | Main Index | Thread Index | Old Index