gcc/libstdc++-v3/testsuite/26_numerics/binary_closure.cc
Benjamin Kosnik b2dad0e372 libstdc++-v3: New directory.
2000-04-21  Benjamin Kosnik  <bkoz@redhat.com>

	* libstdc++-v3: New directory.

From-SVN: r33317
2000-04-21 20:33:34 +00:00

37 lines
740 B
C++

// 19990805 gdr
//
// XXX: to impove later.
// Origin: Andreas Amann <amann@physik.tu-berlin.de>
// CXXFLAGS: -g
#include <iostream>
#include <valarray>
int main()
{
std::valarray<double> a(10), b(10), c(10), d(10);
a = 1.2;
b = 3.1;
c = 4.0;
d = ( 2.0 * b + a ); // works
std::cout << "d[4] = " << d[4] << std::endl;
d = (a * 2.0 + b ); // works
std::cout << "d[4] = " << d[4] << std::endl;
d = (a + b * 2.0 ); // segfaults!
std::cout << "d[4] = " << d[4] << std::endl;
d = (a + 2.0* b );
std::cout << "d[4] = " << d[4] << std::endl;
d = (a + 2.0* b );
std::cout << "d[4] = " << d[4] << std::endl;
d = (a + 2.0* b );
std::cout << "d[4] = " << d[4] << std::endl;
}