Boost logo

Ublas :

Subject: [ublas] norm_inf does not return NaN
From: Uwe Nowak (mail_at_[hidden])
Date: 2009-02-18 11:14:00


Hello!

If there is a NaN value in a vector I expect the norm to be NaN, too.

The following code

boost::numeric::ublas::vector<double> v(1);
v(0) = std::numeric_limits<double>::signaling_NaN();
std::cout << norm_1(v) << std::endl;
std::cout << norm_2(v) << std::endl;
std::cout << norm_inf(v) << std::endl;

prints

nan
nan
0

So norm_1 and norm_2 return NaN correctly, norm_inf does not return NaN.

System:
boost version 1.37
MinGW 5.1.4
Windows XP

Regards,
Uwe