Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removes needless linking on hklmath

  • Loading branch information...
commit 4b1e19a3f580dc30fae7f183e8859acbffdb8240 1 parent 3b8e72c
@pyrated pyrated authored
View
6 src/Makefile.am
@@ -36,10 +36,8 @@ statement/hklr_statement_while.c \
linenoise/linenoise.c
math_SOURCES = module/math.c
-math_SOURCES += hklr.c hkl_value.c hklr_expression.c
+math_SOURCES += hkl_value.c
math_LDFLAGS = -shared -nostartfiles
math_LDADD = -lm
math_CFLAGS = $(AM_CFLAGS)
-math_CFLAGS += -fPIC
-
-
+math_CFLAGS += -fPIC
View
BIN  src/math
Binary file not shown
View
10 src/module/math.c
@@ -3,7 +3,6 @@
#include <math.h>
#include "hkl_value.h"
-#include "hklr_expression.h"
double hklapi_PI = 3.1415926;
double hklapi_TAU = 2.0*3.1415926;
@@ -58,6 +57,15 @@ HklValue* hklapi_log10(HklList* args) {
return hkl_value_new(HKL_TYPE_REAL, log10(d));
}
+HklValue* hklapi_sqrt(HklList* args) {
+
+ HklValue* value = args->head->data;
+ double d = value->as.real;
+ hkl_value_free(value);
+
+ return hkl_value_new(HKL_TYPE_REAL, sqrt(d));
+}
+
HklValue* hklapi_pow(HklList* args) {
HklValue* value = args->head->data;
View
1  src/module/math.hkl
@@ -7,6 +7,7 @@ Math = interface "src/math"
tan: cfunc
log: cfunc
log10: cfunc
+ sqrt: cfunc
pow: cfunc
end

0 comments on commit 4b1e19a

Please sign in to comment.
Something went wrong with that request. Please try again.