iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
ISCIMath
@protocol ISCIMath <NSObject>
Defines the interface to a generic math helper.
-
Gets the min value.
Declaration
Objective-C
@property (nonatomic, readonly) id<ISCIComparable> _Nonnull minValue;
Swift
var minValue: ISCIComparable { get }
-
Gets the max value.
Declaration
Objective-C
@property (nonatomic, readonly) id<ISCIComparable> _Nonnull maxValue;
Swift
var maxValue: ISCIComparable { get }
-
Gets zero value.
Declaration
Objective-C
@property (nonatomic, readonly) id<ISCIComparable> _Nonnull zeroValue;
Swift
var zeroValue: ISCIComparable { get }
-
Gets maximum value of a and b.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)max:(nonnull id<ISCIComparable>)a and:(nonnull id<ISCIComparable>)b;
Swift
func max(_ a: ISCIComparable, and b: ISCIComparable) -> ISCIComparable
Parameters
a
The first value to compare.
b
The second value to compare.
Return Value
The max value.
-
Gets minimum value of a and b.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)min:(nonnull id<ISCIComparable>)a and:(nonnull id<ISCIComparable>)b;
Swift
func min(_ a: ISCIComparable, and b: ISCIComparable) -> ISCIComparable
Parameters
a
The first value to compare.
b
The second value to compare.
Return Value
The min value.
-
Checks whether specified value is NaN value.
Declaration
Objective-C
- (BOOL)isNan:(nonnull id<ISCIComparable>)value;
Swift
func isNan(_ value: ISCIComparable) -> Bool
Parameters
value
The value to check.
Return Value
True if value is NaN.
-
Checks whether specified value is zero value.
Declaration
Objective-C
- (BOOL)isZeroValue:(nonnull id<ISCIComparable>)value;
Swift
func isZeroValue(_ value: ISCIComparable) -> Bool
Parameters
value
The value to check.
Return Value
YES if value is zero in current math, otherwise - NO.
-
Converts specified value to it’s double equivalent.
Declaration
Objective-C
- (double)toDouble:(nonnull id<ISCIComparable>)value;
Swift
func toDouble(_ value: ISCIComparable) -> Double
Parameters
value
The value to convert.
Return Value
The double representation.
-
Converts specified value from it’s double equivalent.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)fromDouble:(double)value;
Swift
func fromDouble(_ value: Double) -> ISCIComparable
Parameters
value
The double equivalent.
Return Value
The value.
-
Multiplies lhs * rhs.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)mult:(nonnull id<ISCIComparable>)lhs byDouble:(double)rhs;
Swift
func mult(_ lhs: ISCIComparable, by rhs: Double) -> ISCIComparable
Parameters
lhs
The first argument.
rhs
The second argument.
Return Value
The result of multiplication.
-
Multiplies lhs * rhs.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)mult:(nonnull id<ISCIComparable>)lhs byInt:(int)rhs;
Swift
func mult(_ lhs: ISCIComparable, by rhs: Int32) -> ISCIComparable
Parameters
lhs
The first argument.
rhs
The second argument.
Return Value
The result of multiplication.
-
Adds lhs + rhs.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)add:(nonnull id<ISCIComparable>)lhs to:(nonnull id<ISCIComparable>)rhs;
Swift
func add(_ lhs: ISCIComparable, to rhs: ISCIComparable) -> ISCIComparable
Parameters
lhs
The first argument.
rhs
The second argument.
Return Value
The result of addition.
-
Subtracts lhs - rhs.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)subtract:(nonnull id<ISCIComparable>)rhs from:(nonnull id<ISCIComparable>)lhs;
Swift
func subtract(_ rhs: ISCIComparable, from lhs: ISCIComparable) -> ISCIComparable
Parameters
rhs
The second argument.
lhs
The first argument.
Return Value
The result of subtraction.
-
Increments value by 1.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)inc:(nonnull id<ISCIComparable>)value;
Swift
func inc(_ value: ISCIComparable) -> ISCIComparable
Parameters
value
The value to increment.
Return Value
The incremented value.
-
Decrements value by 1.
Declaration
Objective-C
- (nonnull id<ISCIComparable>)dec:(nonnull id<ISCIComparable>)value;
Swift
func dec(_ value: ISCIComparable) -> ISCIComparable
Parameters
value
The value to decrement.
Return Value
The decremented value.
-
Compares lhs and rhs values.
Declaration
Objective-C
- (NSComparisonResult)compare:(nonnull id<ISCIComparable>)lhs to:(nonnull id<ISCIComparable>)rhs;
Swift
func compare(_ lhs: ISCIComparable, to rhs: ISCIComparable) -> ComparisonResult
Parameters
lhs
The first argument.
rhs
The second argument.
Return Value
NSOrderedAscending
,NSOrderedSame
, orNSOrderedDescending
if lhs is less than, equal to, or greater than rhs.