From f5c4671bfbad96bf346bd7e9a21fc4317b4959df Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 3 Dec 2022 17:00:20 +0530 Subject: Adds most of the tools --- v_windows/v/vlib/math/log.c.v | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 v_windows/v/vlib/math/log.c.v (limited to 'v_windows/v/vlib/math/log.c.v') diff --git a/v_windows/v/vlib/math/log.c.v b/v_windows/v/vlib/math/log.c.v new file mode 100644 index 0000000..f2f8c93 --- /dev/null +++ b/v_windows/v/vlib/math/log.c.v @@ -0,0 +1,25 @@ +module math + +fn C.log(x f64) f64 + +fn C.log2(x f64) f64 + +fn C.log10(x f64) f64 + +// log calculates natural (base-e) logarithm of the provided value. +[inline] +pub fn log(x f64) f64 { + return C.log(x) +} + +// log2 calculates base-2 logarithm of the provided value. +[inline] +pub fn log2(x f64) f64 { + return C.log2(x) +} + +// log10 calculates the common (base-10) logarithm of the provided value. +[inline] +pub fn log10(x f64) f64 { + return C.log10(x) +} -- cgit v1.2.3