-
Notifications
You must be signed in to change notification settings - Fork 4
compute eq
kgryte edited this page May 12, 2015
·
1 revision
Computes an element-wise comparison (equality) of an array, where x may either be an array of equal length or a single value (of any type).
The function returns an array with length equal to that of the input array. Each output array element is either 0 or 1. A value of 1 means that an element is equal to a compared value and 0 means that an element is not equal to a compared value.
var data = [ 2, 4, 2, 7, 3 ],
out;
out = compute.eq( data, 3 );
// returns [ 0, 0, 0, 0, 1 ]
out = compute.eq( data, [ 3, 4, 1, 7, 4 ] );
// returns [ 0, 1, 0, 1, 0 ]For function options, see compute-eq.
- Utilities
- Array Creation
- Sorting and Reshaping Arrays
- Special Functions
- Arithmetic
- Relational Operations
- Logical Operations
- Trigonometry
- Geometry
- Sets
- Discrete Mathematics
- Linear Algebra
- Statistics