Skip to content
Snippets Groups Projects
Commit 72b1d56a authored by Erick Chandra's avatar Erick Chandra
Browse files

Initial with create random number.

parent 51486e90
No related merge requests found
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <mpi.h>
#include <assert.h>
float *create_rand_nums(int num_elements) {
float *rand_nums = (float *) malloc(sizeof(float) * num_elements);
assert(rand_nums != NULL);
int i;
for (i = 0; i < num_elements; i++) {
rand_nums[i] = (rand() / (float) RAND_MAX);
}
return rand_nums;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment