How to use the equal function from mathjs

Find comprehensive JavaScript mathjs.equal code examples handpicked from public code repositorys.

13
14
15
16
17
18
19
20
21
22
 * */
getIndexRow : function(vector, number) {
    var size = math.subset(math.size(vector), math.index(0));
    for(var index = 0; index < size; ++index) {
        var value = math.subset(vector, math.index(index));
        if( math.equal(value, number) ) {
            return index;
        }
    }
}
fork icon0
star icon0
watch icon0

239
240
241
242
243
244
245
246
247
248
    var e2 = math.abs(math.subtract(y2, ymin));

    if(math.unequal(e0, 0) && math.smaller(e0, err)) err = e0;
    if(math.unequal(e1, 0) && math.smaller(e1, err)) err = e1;
    if(math.unequal(e2, 0) && math.smaller(e2, err)) err = e2;
    if(math.equal(e0, 0) && math.equal(e1, 0) && math.equal(e2, 0)) err = 0;

    if(math.smaller(err, epsilon)) condition = 2;
    if(condition == 2 && math.smaller(h, delta)) condition = 3;
}
fork icon0
star icon0
watch icon0

+ 4 other calls in file