Complete splitting code into source files.

This commit is contained in:
2018-08-17 01:34:58 -07:00
parent dfad4a2cfc
commit 48355b0736
15 changed files with 263 additions and 216 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include "ref.hpp"
#include "util.hpp"
extern "C" {
#include "libabacus.h"
}
@@ -12,7 +14,7 @@ extern "C" {
mpfr_t output; \
mpfr_init2(output, PRECISION); \
mpfr_##func(output, value->value, MPFR_RNDN); \
abacus_ref to_return = create_value<number>(ab, new number(std::move(output))); \
ref to_return = create_value<number>(ab, new number(std::move(output))); \
libab_ref_copy(to_return, into); \
return LIBAB_SUCCESS; \
}
@@ -23,7 +25,7 @@ extern "C" {
mpfr_t output; \
mpfr_init2(output, PRECISION); \
mpfr_##func(output, left->value, right->value, MPFR_RNDN); \
abacus_ref to_return = create_value<number>(ab, new number(std::move(output))); \
ref to_return = create_value<number>(ab, new number(std::move(output))); \
libab_ref_copy(to_return, into); \
return LIBAB_SUCCESS; \
}
@@ -39,23 +41,31 @@ FUNCTION(print_string);
FUNCTION(to_string_num);
FUNCTION(to_string_bool);
FUNCTION(to_string_unit);
FUNCTION(plus);
FUNCTION(minus);
FUNCTION(times);
FUNCTION(divide);
FUNCTION(pow);
FUNCTION(lt);
FUNCTION(lte);
FUNCTION(equals);
FUNCTION(gt);
FUNCTION(gte);
FUNCTION(negate);
FUNCTION(ln);
FUNCTION(exp);
FUNCTION(sin);
FUNCTION(cos);
FUNCTION(tan);
FUNCTION(arcsin);
FUNCTION(arccos);
FUNCTION(arctan);
FUNCTION(quit);
FUNCTION(request_precision);