mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-13 12:53:53 +00:00
Bug fix for math library.
Estimated hours taken: 0.25 Branches: main Bug fix for math library. library/math.m: Changed the order of the parameters for the mercury implementation of math__log_2/2 The old version is incorrect with respect to the library documentation. 'math__log(B, X) = Log' is supposed to return Log as the logarithm to base B of X. After doing domain checks, this predicate calls math__log_2(B, X), which is defined correctly for the C and C# implementations, but had the parameters the wrong way around for the (default) mercury implementation, so it in fact returned Log as the logarithm to base X of B (in other words the reciprocal of what was intended).
This commit is contained in:
@@ -641,7 +641,7 @@ math__log(B, X) = Log :-
|
||||
Log = System.Math.Log(X, B);
|
||||
").
|
||||
% Java implementation will default to mercury here.
|
||||
math__log_2(X, B) = math__ln_2(X) / math__ln_2(B).
|
||||
math__log_2(B, X) = math__ln_2(X) / math__ln_2(B).
|
||||
|
||||
%
|
||||
% math__sin(X) = Sin is true if Sin is the sine of X.
|
||||
|
||||
Reference in New Issue
Block a user