NumberArray Class

The NumberArray class contains static methods that act on arrays of numbers.

Methods

Name Description
constructor(): NumberArray    
create(source: number[] | Float64Array): number[] Static copy numbers from variant sources to number[].  
createArrayWithMaxStepSize(low: number, high: number, step: number): number[] Static Return an array with indicated start and end points, maximum step size internally  
isAlmostEqual(dataA: undefined | number[] | Float64Array, dataB: undefined | number[] | Float64Array, tolerance: number): boolean Static Return true if arrays have identical counts and entries equal within tolerance  
isCoordinateInArray(x: number, data: undefined | number[]): boolean Static test if coordinate x appears (to tolerance by Geometry.isSameCoordinate) in this array of numbers  
isExactEqual(dataA: undefined | any[] | Float64Array, dataB: undefined | any[] | Float64Array): boolean Static Return true if arrays have identical counts and equal entries (using !== comparison)  
maxAbsArray(values: number[]): number Static Return the max absolute value in a array of numbers.  
maxAbsDiff(dataA: number[] | Float64Array, dataB: number[] | Float64Array): number Static Return the max absolute difference between corresponding entries in two arrays of numbers  
maxAbsDiffFloat64(dataA: Float64Array, dataB: Float64Array): number Static Return the max absolute difference between corresponding entries in two Float64Array  
maxAbsTwo(a1: number, a2: number): number Static return the max absolute value of a pair of numbers  
preciseSum(data: number[]): number Static return the sum of values in an array, The summation is done with correction terms which  
sum(data: number[] | Float64Array): number Static return the sum of numbers in an array.  

Defined in

Last Updated: 12 June, 2024