-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMKRealWorldData
More file actions
28 lines (23 loc) · 933 Bytes
/
Copy pathMKRealWorldData
File metadata and controls
28 lines (23 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
// MKRealWorldData.swift
// MathKit
//
// Created by Dazzling Development on 5/26/15.
// Copyright (c) 2015 DAZ. All rights reserved.
//
import Foundation
class MKRealWorldData {
var MathKitBasics = MKBasics()
func interestCompoundContinuously(principle: Double, rate: Double, time: Double) -> Double {
var final: Double!
let power = rate * time
final = principle * MathKitBasics.power(MathKitBasics.e, power: power)
return final
}
func interestCompound(principle: Double, rate: Double, numberOfCompounds: Double, numberOfTime: Double) -> Double {
return principle * MathKitBasics.power(1 + (rate / numberOfCompounds), power: numberOfCompounds * numberOfTime)
}
func exponentialGrowthOrDecay(principle: Double, rate: Double, numberOfTime: Double) -> Double {
return principle * MathKitBasics.power(1 + rate, power: numberOfTime)
}
}