diff --git a/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorFunctionsMathRegistry.java b/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorFunctionsMathRegistry.java index 880fe02c..08f6df04 100644 --- a/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorFunctionsMathRegistry.java +++ b/calculatorpp-core/src/main/java/org/solovyev/android/calculator/CalculatorFunctionsMathRegistry.java @@ -52,7 +52,9 @@ public class CalculatorFunctionsMathRegistry extends AbstractCalculatorMathRegis add(new CustomFunction.Builder(true, "√3", Arrays.asList("x"), "x^(1/3)")); add(new CustomFunction.Builder(true, "√4", Arrays.asList("x"), "x^(1/4)")); add(new CustomFunction.Builder(true, "√n", Arrays.asList("x", "n"), "x^(1/n)")); - } + add(new CustomFunction.Builder(true, "re", Arrays.asList("x"), "(x+conjugate(x))/2")); + add(new CustomFunction.Builder(true, "im", Arrays.asList("x"), "(x-conjugate(x))/(2*i)")); + } public static void saveFunction(@NotNull CalculatorMathRegistry registry, @NotNull MathEntityBuilder builder, diff --git a/calculatorpp/res/layout/calc_functions_button.xml b/calculatorpp/res/layout/calc_functions_button.xml index 66674a3a..10d72a2f 100644 --- a/calculatorpp/res/layout/calc_functions_button.xml +++ b/calculatorpp/res/layout/calc_functions_button.xml @@ -7,9 +7,11 @@ --> \ No newline at end of file + xmlns:c="http://schemas.android.com/apk/res/org.solovyev.android.calculator" + a:id="@+id/functions_button" + c:directionTextScale="0.5" + c:textUp="+ƒ" + a:text="ƒ(x)" + a:textStyle="italic" + a:onClick="functionsButtonClickHandler" + style="?controlButtonStyle" /> \ No newline at end of file diff --git a/calculatorpp/res/layout/calc_operators_button.xml b/calculatorpp/res/layout/calc_operators_button.xml index 78e793a3..3c5b8bd0 100644 --- a/calculatorpp/res/layout/calc_operators_button.xml +++ b/calculatorpp/res/layout/calc_operators_button.xml @@ -7,7 +7,7 @@ --> \ No newline at end of file diff --git a/calculatorpp/res/layout/calc_vars_button.xml b/calculatorpp/res/layout/calc_vars_button.xml index 0005f0f3..a8f5fb9d 100644 --- a/calculatorpp/res/layout/calc_vars_button.xml +++ b/calculatorpp/res/layout/calc_vars_button.xml @@ -8,7 +8,7 @@ + a:inputType="numberDecimal"/>