From 5d4c42a0e7700cf520a401eb4c8db22d44642456 Mon Sep 17 00:00:00 2001 From: serso Date: Sat, 17 Sep 2011 12:51:29 +0400 Subject: [PATCH] fix for asin/acos --- .../solovyev/android/calculator/Preprocessor.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/solovyev/android/calculator/Preprocessor.java b/src/main/java/org/solovyev/android/calculator/Preprocessor.java index de2fc6e0..895c178b 100644 --- a/src/main/java/org/solovyev/android/calculator/Preprocessor.java +++ b/src/main/java/org/solovyev/android/calculator/Preprocessor.java @@ -36,6 +36,12 @@ public class Preprocessor { } else if (s.startsWith("atg", i)) { sb.append("atan"); i += 2; + } else if (s.startsWith("acos", i)) { + sb.append("acos"); + i += 3; + } else if (s.startsWith("asin", i)) { + sb.append("asin"); + i += 3; } else if (s.startsWith("e(", i)) { sb.append("exp("); i += 1; @@ -62,12 +68,12 @@ public class Preprocessor { if (mathTypeBefore != MathEntityType.binary_operation && mathTypeBefore != MathEntityType.unary_operation && - mathTypeBefore != MathEntityType.function && - !MathEntityType.openGroupSymbols.contains(chBefore)) { + mathTypeBefore != MathEntityType.function && + !MathEntityType.openGroupSymbols.contains(chBefore)) { - if (mathType == MathEntityType.constant ) { + if (mathType == MathEntityType.constant) { sb.append("*"); - } else if ( MathEntityType.openGroupSymbols.contains(ch) && mathTypeBefore != null ) { + } else if (MathEntityType.openGroupSymbols.contains(ch) && mathTypeBefore != null) { sb.append("*"); } else if (mathType == MathEntityType.digit && mathTypeBefore != MathEntityType.digit && mathTypeBefore != MathEntityType.dot) { sb.append("*");