~ubuntu-branches/ubuntu/vivid/emscripten/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/core/test_isnan.in

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2014-01-19 14:12:40 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140119141240-nfiw0p8033oitpfz
Tags: 1.9.0~20140119~7dc8c2f-1
* New snapshot release (Closes: #733714)
* Provide sources for javascript and flash. Done in orig-tar.sh
  Available in third_party/websockify/include/web-socket-js/src/
  (Closes: #735903)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
 
 
3
int IsNaN(double x) {
 
4
  int rc; /* The value return */
 
5
  volatile double y = x;
 
6
  volatile double z = y;
 
7
  rc = (y != z);
 
8
  return rc;
 
9
}
 
10
 
 
11
int main() {
 
12
  double tests[] = {1.0, 3.333, 1.0 / 0.0,  0.0 / 0.0, -1.0 / 0.0,
 
13
                    -0,  0,     -123123123, 12.0E200};
 
14
  for (int i = 0; i < sizeof(tests) / sizeof(double); i++)
 
15
    printf("%d - %f - %d\n", i, tests[i], IsNaN(tests[i]));
 
16
}