Fixing styles and adding scientific button
This commit is contained in:
parent
c489247bc4
commit
d94396b6f5
2 changed files with 7 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
|||
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.UnaryOperation
|
||||
|
||||
|
@ -10,17 +9,13 @@ class ParOperation(value: Double) : UnaryOperation(value), Operation {
|
|||
var result = 1.0
|
||||
if (value==0.0 || value==1.0){
|
||||
return result
|
||||
}
|
||||
else {
|
||||
var base: Int
|
||||
base = value.toInt()
|
||||
} else {
|
||||
var base: Int = value.toInt()
|
||||
for (i in 1..base){
|
||||
//Find Factorial of a number using for loop
|
||||
result *= i
|
||||
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/scientific"
|
||||
android:title="Scientific Calculator"
|
||||
app:showAsAction="never"/>
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:title="@string/settings"
|
||||
|
|
Loading…
Reference in a new issue