Remove PI constant redefinition

This commit is contained in:
augustin64 2023-06-05 21:00:55 +02:00
parent b72227496e
commit 84759caf0b
2 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@
// Génère un flottant entre 0 et 1 // Génère un flottant entre 0 et 1
#define RAND_FLT() ((float)rand())/((float)RAND_MAX) #define RAND_FLT() ((float)rand())/((float)RAND_MAX)
#define TWOPI 6.2831853071795864769252867665
#define ZERO 0 #define ZERO 0
#define GLOROT 1 #define GLOROT 1

View File

@ -15,7 +15,7 @@ float randn() {
while (f1 == 0) { while (f1 == 0) {
f1 = RAND_FLT(); f1 = RAND_FLT();
} }
return sqrt(-2.0*log(f1))*cos(TWOPI*RAND_FLT()); return sqrt(-2.0*log(f1))*cos(2*M_PI*RAND_FLT());
} }
void initialisation_1d_matrix(int initialisation, float* matrix, int dim, int n_in, int n_out) { void initialisation_1d_matrix(int initialisation, float* matrix, int dim, int n_in, int n_out) {