Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to fix that for 32 bits platforms
authordegomme <augustin.degomme@unibas.ch>
Fri, 11 Mar 2016 14:34:34 +0000 (15:34 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Fri, 11 Mar 2016 14:34:50 +0000 (15:34 +0100)
examples/smpi/NAS/nas_common.c
examples/smpi/NAS/nas_common.h

index 51ac28f..5783e8c 100644 (file)
@@ -117,8 +117,8 @@ double timer_read(int n)
 double vranlc(int n, double x, double a, double *y)
 {
   int i;
 double vranlc(int n, double x, double a, double *y)
 {
   int i;
-  long  i246m1=0x00003FFFFFFFFFFF;
-  long  LLx, Lx, La;
+  uint64_t  i246m1=0x00003FFFFFFFFFFF;
+  uint64_t  LLx, Lx, La;
   double d2m46;
 
 // This doesn't work, because the compiler does the calculation in 32 bits and overflows. No standard way (without
   double d2m46;
 
 // This doesn't work, because the compiler does the calculation in 32 bits and overflows. No standard way (without
@@ -127,8 +127,8 @@ double vranlc(int n, double x, double a, double *y)
 
   d2m46=pow(0.5,46);
 
 
   d2m46=pow(0.5,46);
 
-  Lx = (long)x;
-  La = (long)a;
+  Lx = (uint64_t)x;
+  La = (uint64_t)a;
   //fprintf(stdout,("================== Vranlc ================");
   //fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La);
   LLx = Lx;
   //fprintf(stdout,("================== Vranlc ================");
   //fprintf(stdout,("Before Loop: Lx = " + Lx + ", La = " + La);
   LLx = Lx;
index 1990c0d..4d7f29c 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <math.h>
 #include "mpi.h"
 
 #include <math.h>
 #include "mpi.h"