From 6040d92222dc97ca4fcd5ef1805d3536da4ea08d Mon Sep 17 00:00:00 2001 From: Leonardo Date: Mon, 21 Oct 2019 21:11:36 +0300 Subject: [PATCH] Adds the function log10 --- src/core/env.ml | 1 + src/core/interpreter.ml | 1 + src/generators/defaultReplacements.ml | 1 + src/version.ml | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/env.ml b/src/core/env.ml index 3e4b363a..7aa2bd65 100644 --- a/src/core/env.ml +++ b/src/core/env.ml @@ -585,6 +585,7 @@ let builtin_table = ; [ "makeArray" ], Scope.Function, Typ.Const.array_make (), false ; [ "abs" ], Scope.Function, Typ.Const.freal_freal (), false ; [ "exp" ], Scope.Function, Typ.Const.freal_freal (), false + ; [ "log10" ], Scope.Function, Typ.Const.freal_freal (), false ; [ "sin" ], Scope.Function, Typ.Const.freal_freal (), false ; [ "cos" ], Scope.Function, Typ.Const.freal_freal (), false ; [ "floor" ], Scope.Function, Typ.Const.freal_freal (), false diff --git a/src/core/interpreter.ml b/src/core/interpreter.ml index dff18f4c..2ed1f4da 100644 --- a/src/core/interpreter.ml +++ b/src/core/interpreter.ml @@ -547,6 +547,7 @@ let builtinFunctions (a : Args.args) env = in let functions = [ "abs", Env.Builtin (real_real abs_float) + ; "log10", Env.Builtin (real_real log10) ; "exp", Env.Builtin (real_real exp) ; "sin", Env.Builtin (real_real sin) ; "cos", Env.Builtin (real_real cos) diff --git a/src/generators/defaultReplacements.ml b/src/generators/defaultReplacements.ml index 980118fe..c92a9605 100644 --- a/src/generators/defaultReplacements.ml +++ b/src/generators/defaultReplacements.ml @@ -128,6 +128,7 @@ module Default = struct ; ("msu", "float"), "float_msu" ; ("abs", "float"), "fabsf" ; ("exp", "float"), "expf" + ; ("log10", "float"), "log10f" ; ("floor", "float"), "floorf" ; ("max", "float"), "fmax" ; ("min", "float"), "fmin" diff --git a/src/version.ml b/src/version.ml index 12003b65..cc45e661 100644 --- a/src/version.ml +++ b/src/version.ml @@ -1 +1 @@ -let version = "\nv0.4.4\n" +let version = "\nv0.4.5\n"