log function added + refactor of strings

This commit is contained in:
Sergey Solovyev
2011-12-24 17:26:45 +04:00
parent d0d580552f
commit ef05f198e9
21 changed files with 449 additions and 252 deletions

View File

@@ -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() {

View File

@@ -284,6 +284,9 @@ public enum CalculatorEngine {
}
varsRegistry.load(context, preferences);
functionsRegistry.load(context, preferences);
operatorsRegistry.load(context, preferences);
postfixFunctionsRegistry.load(context, preferences);
}
}