aboutsummaryrefslogtreecommitdiff
path: root/core/math.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-12 10:46:00 +0100
committergingerBill <bill@gingerbill.org>2018-05-12 10:46:00 +0100
commit9fbfd86cde08f307eccbaef7d565007f54a41bca (patch)
tree823e774f7a3def31c5d485b69d97b52b547755c2 /core/math.odin
parent7547bc66cf7ec54b0dd65d1cc9148595388cd08f (diff)
Add `log` to math.odin
Diffstat (limited to 'core/math.odin')
-rw-r--r--core/math.odin7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/math.odin b/core/math.odin
index 8bc288185..53592b8b7 100644
--- a/core/math.odin
+++ b/core/math.odin
@@ -51,8 +51,15 @@ foreign __llvm_core {
fmuladd_f32 :: proc(a, b, c: f32) -> f32 ---;
@(link_name="llvm.fmuladd.f64")
fmuladd_f64 :: proc(a, b, c: f64) -> f64 ---;
+
+ @(link_name="llvm.log.f32")
+ log_f32 :: proc(x: f32) -> f32 ---;
+ @(link_name="llvm.log.f64")
+ log_f64 :: proc(x: f64) -> f64 ---;
}
+log :: proc[log_f32, log_f64];
+
tan_f32 :: proc "c" (θ: f32) -> f32 { return sin(θ)/cos(θ); }
tan_f64 :: proc "c" (θ: f64) -> f64 { return sin(θ)/cos(θ); }