log function added + refactor of strings
This commit is contained in:
@@ -6,8 +6,11 @@
|
||||
|
||||
package org.solovyev.android.calculator.model;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import jscl.math.function.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.solovyev.android.calculator.R;
|
||||
import org.solovyev.common.definitions.IBuilder;
|
||||
import org.solovyev.common.math.MathRegistry;
|
||||
@@ -113,6 +116,13 @@ public class AndroidFunctionsMathRegistry extends AbstractAndroidMathRegistry<Fu
|
||||
super(functionsRegistry, FUNCTION_DESCRIPTION_PREFIX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(@Nullable Context context, @Nullable SharedPreferences preferences) {
|
||||
super.load(context, preferences);
|
||||
|
||||
add(new CustomFunction.Builder(true, "log", new String[]{"a", "b"}, "ln(b)/ln(a)"));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Map<String, String> getSubstitutes() {
|
||||
|
@@ -284,6 +284,9 @@ public enum CalculatorEngine {
|
||||
}
|
||||
|
||||
varsRegistry.load(context, preferences);
|
||||
functionsRegistry.load(context, preferences);
|
||||
operatorsRegistry.load(context, preferences);
|
||||
postfixFunctionsRegistry.load(context, preferences);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user