Code Monkey home page Code Monkey logo

deno_math_jsr's Introduction

Build Status

math

The math module is used to provide a helper for high-precision calculations and scientific computing.

Usage

All the following modules are exposed in mod.ts

Big

A class for high-precision calculations.

import { Big } from "https://deno.land/x/[email protected]/mod.ts";

new Big(0.1).plus(0.2).toString(); // '0.3'

Documentation

Matrix

A class for Matrix computing.

import { Matrix } from "https://deno.land/x/[email protected]/mod.ts";

const m = new Matrix([
  [1, 2, 3],
  [4, 5, 6]
]).transpose();

console.log(m.toString());
/**
1, 4
2, 5
3, 6
*/

Documentation

abs

get a numeric absolute value.

import { abs } from "https://deno.land/x/[email protected]/mod.ts";

abs(-1); // '1'
abs("-0.1"); // '0.1'

min

get a smaller numeric from a numeric set. Similar to Math.min.

import { min } from "https://deno.land/x/[email protected]/mod.ts";

min([-1, 0, "1"]); // '-1'

max

get a larger numeric from a numeric set. Similar to Math.max.

import { max } from "https://deno.land/x/[email protected]/mod.ts";

max([-1, 0, "1"]); // '1'

sum

get the sum of a numeric set.

import { sum } from "https://deno.land/x/[email protected]/mod.ts";

sum([1, "2", 3]); // '6'

plus

get the value of a numeric plus another numeric. Similar to Javascript + operator.

import { plus } from "https://deno.land/x/[email protected]/mod.ts";

plus("1", 2); // '3'

minus

get the value of a numeric minus another numeric. Similar to Javascript - operator.

import { minus } from "https://deno.land/x/[email protected]/mod.ts";

minus("1", 2); // '-1'

times

get the value of a numeric times another numeric. Similar to Javascript * operator.

import { times } from "https://deno.land/x/[email protected]/mod.ts";

times("1", 2); // '2'

div

get the value of a numeric divided another numeric. Similar to Javascript / operator.

import { div } from "https://deno.land/x/[email protected]/mod.ts";

div("1", 2); // '0.5'

mod

get the value of a numeric modulo another numeric. Similar to Javascript % operator.

import { mod } from "https://deno.land/x/[email protected]/mod.ts";

mod("3", 2); // '1'

pow

get the value of a numeric raised to the power another numeric. Similar to Math.pow.

import { pow } from "https://deno.land/x/[email protected]/mod.ts";

pow("3", 2); // '9'

sqrt

get the value is the square root of a numeric. Similar to Math.sqrt.

import { sqrt } from "https://deno.land/x/[email protected]/mod.ts";

sqrt("3", 2); // '1.7320508075688772'

round

get the value of input rounded using rounding mode rm to a maximum of dp decimal places. Similar to Math.round.

import { round } from "https://deno.land/x/[email protected]/mod.ts";

round("3.456", 2); // '3.46'

toExponential

get an exponential notation string from a numeric. Similar to Number.prototype.toExponential.

import { toExponential } from "https://deno.land/x/[email protected]/mod.ts";

toExponential("3.456", 2); // '3.46e+0'

toFixed

get a normal notation string from a numeric. Similar to Number.prototype.toFixed.

import { toFixed } from "https://deno.land/x/[email protected]/mod.ts";

toFixed("3.4", 6); // '3.400000'

toPrecision

get the value of a numeric to the specified number of sd significant digits. Similar to Number.prototype.toPrecision.

import { toPrecision } from "https://deno.land/x/[email protected]/mod.ts";

toPrecision("3.4567890", 6); // '3.456789'

eq

Where a numeric equal to another numeric. Similar to Javascript === operator.

import { eq } from "https://deno.land/x/[email protected]/mod.ts";

eq("1.200", "1.2e+0"); // true

gt

Where a numeric greater than another numeric. Similar to Javascript > operator.

import { gt } from "https://deno.land/x/[email protected]/mod.ts";

gt(2, "1"); // true

gte

Where a numeric greater than or equal to another numeric. Similar to Javascript >= operator.

import { gte } from "https://deno.land/x/[email protected]/mod.ts";

gte(2, "1"); // true
gte(2, "2"); // true
gte(2, "3"); // false

lt

Where a numeric less than another numeric. Similar to Javascript < operator.

import { lt } from "https://deno.land/x/[email protected]/mod.ts";

lt(2, "1"); // false
lt(2, "2"); // false
lt(2, "3"); // false

lte

Where a numeric less than or equal to another numeric. Similar to Javascript <= operator.

import { lte } from "https://deno.land/x/[email protected]/mod.ts";

lte(2, "1"); // false
lte(2, "2"); // true
lte(2, "3"); // false

deno_math_jsr's People

Contributors

axetroy avatar zhmushan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.