File: parse.c

package info (click to toggle)
node-webassemblyjs 1.11.0%2Bdfsg%2B~cs10.10.16-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,040 kB
  • sloc: javascript: 28,630; makefile: 84; sh: 42; ansic: 16
file content (24 lines) | stat: -rw-r--r-- 412 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#include "math.h"
#include "float.h"

int main(int argc, char *argv[]) {
	// test id
	int i = atoi(argv[1]);

	/* Intializes random number generator */
	srand(time(NULL) + i);

	double m = rand() / (RAND_MAX / 100.0);

	double r = (double) rand() / (RAND_MAX / exp(m));

	if(rand() > RAND_MAX/2) {
		r = -r;
	}

	printf("%a %.100f\n", r, r);
	return 0;
}