~ubuntu-branches/ubuntu/utopic/blitz++/utopic-proposed

« back to all changes in this revision

Viewing changes to testsuite/int-math-func.cpp

  • Committer: Package Import Robot
  • Author(s): Christophe Trophime
  • Date: 2012-07-06 09:15:30 UTC
  • mfrom: (11.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120706091530-vzrb8zf0vpbf8tp9
Tags: 1:0.10-1
* New upstream release
  Closes: #679407
* debian/rules:
  - update for new release
  - add override_dh_auto_test target
  - regenerate configure and Makefile.am
* debian/control:
  - add libtool, automake to BuildDepends
* debian/libblitz-doc.install
  - modify path for html files
* remove uneeded patches
* add examples.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "testsuite.h"
 
2
#include <blitz/array.h>
 
3
 
 
4
BZ_USING_NAMESPACE(blitz)
 
5
 
 
6
// test that math functions operating on integers return doubles and not ints
 
7
 
 
8
int main()
 
9
{
 
10
  Array<double,1> a(10);
 
11
  Array<int,1> b(10);
 
12
  b=tensor::i;
 
13
  a=sqrt(b);
 
14
 
 
15
  cout << a ; 
 
16
  BZTEST(a(2)==sqrt(2));
 
17
  BZTEST(a(5)==sqrt(5));
 
18
  
 
19
  a=sqrt(tensor::i); 
 
20
  cout << a ; 
 
21
  BZTEST(a(2)==sqrt(2));
 
22
  BZTEST(a(5)==sqrt(5));
 
23
 
 
24
  // we can't really test that the powN and abs are not cast to
 
25
  // doubles because it's not really visible from the outside.
 
26
 
 
27
  return 0;
 
28
}
 
29