mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
13 lines
465 B
JavaScript
13 lines
465 B
JavaScript
// test re
|
|
var assert = require('assert');
|
|
var math = require('../../../math.js');
|
|
|
|
assert.equal(math.re(math.complex(2,3)), 2);
|
|
assert.equal(math.re(math.complex(-2,-3)), -2);
|
|
assert.equal(math.re(math.i), 0);
|
|
assert.equal(math.re(2), 2);
|
|
assert.equal(math.re('string'), 'string');
|
|
assert.equal(math.re(true), true);
|
|
assert.deepEqual(math.re([2, math.complex('3-6i')]), [2, 3]);
|
|
assert.deepEqual(math.re(math.matrix([2, math.complex('3-6i')])).valueOf(), [2, 3]);
|