Select Page
Latest 0.1.2 https://github.com/YHQiu/FunctionCalculate MIT ios 8.0 https://github.com/YHQiu

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

//Initial calculate

let fc = FunctionCalculate(param1: 11, param2: 5)

//Calculate combination

let combination = fc.calculate(calculateMethod: Combination())

//Calculate permutation

let permutation = fc.calculate(calculateMethod: Permutation())

//Calculate GrestestCommon LowestCommonMultiple

let fc1 = FunctionCalculate(params: 131072131072131072,646464,128128128,256256256,512512512,102410241024,204820482048,409640964096,819281928192,163841638416384,327683276832768,655366553665536)

let grestestCommon = fc1.calculate(calculateMethod: GreatestCommonDivisor())

let lowestCommon = fc1.calculate(calculateMethod: LowestCommonMultiple())

print("combination = "+"(combination)");

print("combination = "+"(combination.0)")

print("permutation = "+"(permutation)");

print("permutation = "+"(permutation.0)")

print("grestestCommon = "+"(grestestCommon)")

print("grestestCommon = "+"(grestestCommon.0)")

print("lowestCommon = "+"(lowestCommon)")

print("lowestCommon = "+"(lowestCommon.2!)")

Print Results:

combination = (462.0, 462, Optional("462.0"))

combination = 462.0

permutation = (55440.0, 55440, Optional("55440.0"))

permutation = 55440.0

grestestCommon = (64.0, 64, Optional("64"))

grestestCommon = 64.0

lowestCommon = (-1.0, -1, Optional(" 2^6 3 5 7 11 13 37 10001 115597 295931 * 333667"))

lowestCommon = 2^6 3 5 7 11 13 37 10001 115597 295931 * 333667

## Requirements

only support swift

## Installation

FunctionCalculate is available through CocoaPods. To install
it, simply add the following line to your Podfile:

``pod 'FunctionCalculate'``

## Author

FunctionCalculate is available under the MIT license. See the LICENSE file for more info.

### Latest podspec

```{
"name": "FunctionCalculate",
"version": "0.1.2",
"summary": "a function style science calculate framework by protocol.",
"description": "Now support Combination,Permutation,Greatest Common Divisor,Lowest Common Multiple.",
"homepage": "https://github.com/YHQiu/FunctionCalculate",
"type": "MIT",
},
"authors": {
"https://github.com/YHQiu": "[email protected]"
},
"source": {
"git": "https://github.com/YHQiu/FunctionCalculate.git",
"tag": "0.1.2"
},
"platforms": {
"ios": "8.0"
},
"source_files": "FunctionCalculate/Classes/**/*",
"pushed_with_swift_version": "3.0"
}```