2016-03-25 13:03:49 -07:00
|
|
|
exports.print = function (obj) {
|
2020-03-20 13:28:31 -07:00
|
|
|
return obj.constructor.name;
|
|
|
|
};
|
2015-12-30 01:41:31 +05:30
|
|
|
|
2016-03-25 13:03:49 -07:00
|
|
|
exports.echo = function (obj) {
|
2020-03-20 13:28:31 -07:00
|
|
|
return obj;
|
|
|
|
};
|
2016-07-25 16:30:40 +09:00
|
|
|
|
2018-05-24 14:05:46 +02:00
|
|
|
const typedArrays = {
|
|
|
|
Int8Array,
|
|
|
|
Uint8Array,
|
|
|
|
Uint8ClampedArray,
|
|
|
|
Int16Array,
|
|
|
|
Uint16Array,
|
|
|
|
Int32Array,
|
|
|
|
Uint32Array,
|
|
|
|
Float32Array,
|
|
|
|
Float64Array
|
2020-03-20 13:28:31 -07:00
|
|
|
};
|
2018-05-24 14:05:46 +02:00
|
|
|
|
|
|
|
exports.typedArray = function (type, values) {
|
2020-03-20 13:28:31 -07:00
|
|
|
const constructor = typedArrays[type];
|
|
|
|
const array = new constructor(values.length);
|
2018-05-24 14:05:46 +02:00
|
|
|
for (let i = 0; i < values.length; ++i) {
|
2020-03-20 13:28:31 -07:00
|
|
|
array[i] = values[i];
|
2016-07-25 16:30:40 +09:00
|
|
|
}
|
2020-03-20 13:28:31 -07:00
|
|
|
return array;
|
|
|
|
};
|
2018-06-13 04:38:31 -03:00
|
|
|
|
|
|
|
exports.getNaN = function () {
|
2020-03-20 13:28:31 -07:00
|
|
|
return NaN;
|
|
|
|
};
|
2018-06-13 04:38:31 -03:00
|
|
|
|
|
|
|
exports.getInfinity = function () {
|
2020-03-20 13:28:31 -07:00
|
|
|
return Infinity;
|
|
|
|
};
|