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: any ISCIComparable { get } -
Gets the max value.
Declaration
Objective-C
@property (nonatomic, readonly) id<ISCIComparable> _Nonnull maxValue;Swift
var maxValue: any ISCIComparable { get } -
Gets zero value.
Declaration
Objective-C
@property (nonatomic, readonly) id<ISCIComparable> _Nonnull zeroValue;Swift
var zeroValue: any 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: any ISCIComparable, and b: any ISCIComparable) -> any ISCIComparableParameters
aThe first value to compare.
bThe 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: any ISCIComparable, and b: any ISCIComparable) -> any ISCIComparableParameters
aThe first value to compare.
bThe 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: any ISCIComparable) -> BoolParameters
valueThe 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: any ISCIComparable) -> BoolParameters
valueThe 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: any ISCIComparable) -> DoubleParameters
valueThe 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) -> any ISCIComparableParameters
valueThe 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: any ISCIComparable, by rhs: Double) -> any ISCIComparableParameters
lhsThe first argument.
rhsThe 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: any ISCIComparable, by rhs: Int32) -> any ISCIComparableParameters
lhsThe first argument.
rhsThe 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: any ISCIComparable, to rhs: any ISCIComparable) -> any ISCIComparableParameters
lhsThe first argument.
rhsThe 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: any ISCIComparable, from lhs: any ISCIComparable) -> any ISCIComparableParameters
rhsThe second argument.
lhsThe 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: any ISCIComparable) -> any ISCIComparableParameters
valueThe 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: any ISCIComparable) -> any ISCIComparableParameters
valueThe 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: any ISCIComparable, to rhs: any ISCIComparable) -> ComparisonResultParameters
lhsThe first argument.
rhsThe second argument.
Return Value
NSOrderedAscending,NSOrderedSame, orNSOrderedDescendingif lhs is less than, equal to, or greater than rhs.
View on GitHub