-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:JuliaLang/julia
- Loading branch information
Showing
17 changed files
with
150 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/dsfmt-* | ||
/mt19937-64* | ||
/libMT* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#ifndef __IEEE754_H_ | ||
#define __IEEE754_H_ | ||
|
||
#ifdef __linux | ||
|
||
#include <ieee754.h> | ||
|
||
#else | ||
|
||
union ieee754_float { | ||
float f; | ||
|
||
struct { | ||
#if BYTE_ORDER == BIG_ENDIAN | ||
unsigned int negative:1; | ||
unsigned int exponent:8; | ||
unsigned int mantissa:23; | ||
#endif | ||
#if BYTE_ORDER == LITTLE_ENDIAN | ||
unsigned int mantissa:23; | ||
unsigned int exponent:8; | ||
unsigned int negative:1; | ||
#endif | ||
} ieee; | ||
}; | ||
|
||
#define IEEE754_FLOAT_BIAS 0x7f | ||
|
||
union ieee754_double { | ||
double d; | ||
|
||
struct { | ||
#if BYTE_ORDER == BIG_ENDIAN | ||
unsigned int negative:1; | ||
unsigned int exponent:11; | ||
unsigned int mantissa0:20; | ||
unsigned int mantissa1:32; | ||
#endif | ||
#if BYTE_ORDER == LITTLE_ENDIAN | ||
unsigned int mantissa1:32; | ||
unsigned int mantissa0:20; | ||
unsigned int exponent:11; | ||
unsigned int negative:1; | ||
#endif | ||
} ieee; | ||
}; | ||
|
||
#define IEEE754_DOUBLE_BIAS 0x3ff | ||
|
||
union ieee854_long_double { | ||
long double d; | ||
|
||
struct { | ||
#if BYTE_ORDER == BIG_ENDIAN | ||
unsigned int negative:1; | ||
unsigned int exponent:15; | ||
unsigned int empty:16; | ||
unsigned int mantissa0:32; | ||
unsigned int mantissa1:32; | ||
#endif | ||
#if BYTE_ORDER == LITTLE_ENDIAN | ||
unsigned int mantissa1:32; | ||
unsigned int mantissa0:32; | ||
unsigned int exponent:15; | ||
unsigned int negative:1; | ||
unsigned int empty:16; | ||
#endif | ||
} ieee; | ||
}; | ||
|
||
#define IEEE854_LONG_DOUBLE_BIAS 0x3fff | ||
|
||
#endif // ifdef __APPLE__ ... | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef __JL_RANDOM_H_ | ||
#define __JL_RANDOM_H_ | ||
|
||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <math.h> | ||
#include <sys/time.h> | ||
#include <stdint.h> | ||
#include "ieee754.h" | ||
|
||
double rand_double(); | ||
float rand_float(); | ||
double randn(); | ||
void randomize(); | ||
uint32_t genrand_int32(); | ||
void randomseed32(uint32_t s); | ||
void randomseed64(uint64_t s); | ||
|
||
#endif |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.