Fixing styles and adding scientific button

This commit is contained in:
Sissy Dalampira 2018-10-05 23:12:26 +03:00
parent c489247bc4
commit d94396b6f5
2 changed files with 7 additions and 8 deletions

View File

@ -1,6 +1,5 @@
package com.simplemobiletools.calculator.operation package com.simplemobiletools.calculator.operation
import com.simplemobiletools.calculator.operation.base.BinaryOperation
import com.simplemobiletools.calculator.operation.base.Operation import com.simplemobiletools.calculator.operation.base.Operation
import com.simplemobiletools.calculator.operation.base.UnaryOperation import com.simplemobiletools.calculator.operation.base.UnaryOperation
@ -10,17 +9,13 @@ class ParOperation(value: Double) : UnaryOperation(value), Operation {
var result = 1.0 var result = 1.0
if (value==0.0 || value==1.0){ if (value==0.0 || value==1.0){
return result return result
} } else {
else { var base: Int = value.toInt()
var base: Int
base = value.toInt()
for (i in 1..base){ for (i in 1..base){
//Find Factorial of a number using for loop //Find Factorial of a number using for loop
result *= i result *= i
} }
} }
return result return result
} }
} }

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/scientific"
android:title="Scientific Calculator"
app:showAsAction="never"/>
<item <item
android:id="@+id/settings" android:id="@+id/settings"
android:title="@string/settings" android:title="@string/settings"