heptagon/examples/random/mathext.c
Gwenaël Delaval d5ee87b7ed Added example Markov
Example Markov : simulation of a Markov chain.

Use of a Random module, external call to C rand() function.
2015-09-17 11:17:29 +02:00

16 lines
204 B
C

#include <stdlib.h>
#include "mathext.h"
void Mathext__power_step(float x, int n, Mathext__power_out *o) {
float r;
int i;
r = 1.0;
for (i = 1; i <= n; i++) {
r = r * x;
}
o->y = r;
}