-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
11 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
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,39 @@ | ||
#ifndef RUNTIME_H | ||
#define RUNTIME_H | ||
|
||
#include <inttypes.h> | ||
#include <math.h> | ||
#include <stdio.h> | ||
|
||
typedef struct FunctionClosure_ { | ||
void *function; | ||
} FunctionClosure; | ||
|
||
int64_t mc_print_inf_f(FunctionClosure *self, int64_t i); | ||
FunctionClosure mc_print_int; | ||
|
||
int64_t mc_print_newline_f(FunctionClosure *self, int64_t i); | ||
FunctionClosure mc_print_newline; | ||
|
||
double mc_float_of_int_f(FunctionClosure *self, int64_t i); | ||
FunctionClosure mc_float_of_int; | ||
|
||
int64_t mc_int_of_float_f(FunctionClosure *self, double d); | ||
FunctionClosure mc_int_of_float; | ||
|
||
// truncate = int_of_float | ||
FunctionClosure mc_truncate; | ||
|
||
double mc_abs_float_f(FunctionClosure *self, double d); | ||
FunctionClosure mc_abs_float; | ||
|
||
double mc_sqrt_f(FunctionClosure *self, double d); | ||
FunctionClosure mc_sqrt; | ||
|
||
double mc_sin_f(FunctionClosure *self, double d); | ||
FunctionClosure mc_sin; | ||
|
||
double mc_cos_f(FunctionClosure *self, double d); | ||
FunctionClosure mc_cos; | ||
|
||
#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