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

« back to all changes in this revision

Viewing changes to tests/core/test_math.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
#include <stdlib.h>
 
3
#include <cmath>
 
4
int main(int argc, char **argv) {
 
5
  printf("*%.2f,%.2f,%d", M_PI, -M_PI, (1 / 0.0) > 1e300);  // could end up as
 
6
                                                            // infinity, or just
 
7
                                                            // a very very big
 
8
                                                            // number
 
9
  printf(",%d", isfinite(NAN) != 0);
 
10
  printf(",%d", isfinite(INFINITY) != 0);
 
11
  printf(",%d", isfinite(-INFINITY) != 0);
 
12
  printf(",%d", isfinite(12.3) != 0);
 
13
  printf(",%d", isinf(NAN) != 0);
 
14
  printf(",%d", isinf(INFINITY) != 0);
 
15
  printf(",%d", isinf(-INFINITY) != 0);
 
16
  printf(",%d", isinf(12.3) != 0);
 
17
  div_t div_result = div(23, 10);
 
18
  printf(",%d", div_result.quot);
 
19
  printf(",%d", div_result.rem);
 
20
  double sine = -1.0, cosine = -1.0;
 
21
  sincos(0.0, &sine, &cosine);
 
22
  printf(",%1.1lf", sine);
 
23
  printf(",%1.1lf", cosine);
 
24
  float fsine = -1.0f, fcosine = -1.0f;
 
25
  sincosf(0.0, &fsine, &fcosine);
 
26
  printf(",%1.1f", fsine);
 
27
  printf(",%1.1f", fcosine);
 
28
  fsine = sinf(1.1 + argc - 1);
 
29
  fcosine = cosf(1.1 + argc - 1);
 
30
  printf(",%1.1f", fsine);
 
31
  printf(",%1.1f", fcosine);
 
32
  printf("*\n");
 
33
  return 0;
 
34
}