-
Notifications
You must be signed in to change notification settings - Fork 0
/
cstuff.c
47 lines (33 loc) · 892 Bytes
/
cstuff.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
system-function for Fortran
(C) Marat Khairoutdinov */
#if ( defined SUNOS ) || ( defined IRIX64 ) || ( defined OSF1 ) || ( defined LINUX )
#define FORTRANUNDERSCORE
#elif ( defined CRAY ) || ( defined T3D )
#define FORTRANCAPS
#elif ( defined AIX || defined MACOSX)
#endif
#if ( defined FORTRANCAPS )
#define systemf SYSTEMF
#define gammafff GAMMAFFF
#define erfff ERFFF
#elif ( defined FORTRANUNDERSCORE )
#define systemf systemf_
#define gammafff gammafff_
#define erfff erfff_
#elif ( defined FORTRANDOUBLEUNDERSCORE )
#define systemf systemf__
#define gammafff gammafff__
#define erfff erfff__
#endif
#include <math.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
void systemf (const char *string) {system(string);}
float gammafff (float *x) {return (float)exp(lgamma(*x));}
float erfff (float *x) {return (float)erf(*x);}
#ifdef __cplusplus
}
#endif