npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-ts-math

v2.0.1

Published

Angular ts numbers and math!

Downloads

432

Readme

angular-ts-math

An angular repository for numbers and math.

Dependencies:

Content

Install

npm install angular-ts-math

Import

import { angularMath } from 'angular-ts-math/dist/angular-ts-math/angular-ts-math';

Use

Constants
  • get the pi value angularMath.getPi();
  • get the e value angularMath.getE();
  • get the ln2 value angularMath.getLn2();
  • get the ln10 value angularMath.getLn10();
  • get the log2 of e value angularMath.getLog2E();
  • get the log10 of e value angularMath.getLog10E();
  • get the min safe angularMath.getMinSafeInteger();
  • get the max sage angularMath.getMaxSafeInteger();
Random
  • get random values between [0,1) angularMath.getRandom();
  • get random integer values between the min and max angularMath.getIntegerRandomRange(min, max);
  • get random n integers numbers between min and max angularMath.getNIntegerRandomRange(min, max, n);
Utils
  • check if the value is type number angularMath.isNumber(number);
  • check if the number is integer angularMath.isInteger(number);
  • check if the number is even angularMath.isEven(number);
  • check if the number is odd angularMath.isOdd(number);
  • check if the number is palindrome angularMath.isPalindrome(number);
Convert
  • convert a number to string angularMath.numberToString(number);
  • convert a number to binary angularMath.numberToBinary(number);
  • convert a number to octal angularMath.numberToOct(number);
  • convert a number to hexadecimal angularMath.numberToHex(number);
Number actions
  • get x% percent of a number angularMath.percentOfNumber(number, percent);
  • change the sign of a number angularMath.oppositeOfNumber(number);
  • get the rest of a div from 2 numbers angularMath.getRest(number, div);
  • get integer of a number angularMath.integerOfNumber(number);
  • get the number with a specific number of decimals angularMath.getNumberWithDecimals(number, decimals);
  • convert a number in a positive one angularMath.absoluteOfNumber(number);
  • get the power of a number angularMath.powerOfNumber(number, power);
  • get the square of a number angularMath.squareOfNumber(number);
  • get logarithm of a number angularMath.logarithmOfNumber(number);
  • get the nearest integer number of a number angularMath.nearOfNumber(number);
  • get the nearest next integer number of a number angularMath.nextIntegerOfNumber(number);
  • get the nearest back integer number of a number angularMath.backIntegerOfNumber(number);
  • get the reverse number of a number angularMath.reverseOfNumber(number);
  • get the length of a number angularMath.lengthOfNumber(number);
  • count the number of a specific figure in a number angularMath.figureOfNumber(number, figure);
  • get the factorial of an integer number angularMath.factorialOfNumber(number);
Operations
  • get the sum of n numbers angularMath.sum(n1, n2, n3, ...);
  • get the dif of n numbers, starting with the first angularMath.dif(n1, n2, n3, ...);
  • get the mul of n numbers angularMath.mul(n1, n2, n3, ...);
  • get the div of n numbers, starting with the first angularMath.div(n1, n2, n3, ...);
  • get the min value of n numbers angularMath.getMinimum(n1, n2, n3, ...);
  • get the max value of n numbers angularMath.getMaximum(n1, n2, n3, ...);
  • get the sum between integers min and max (sigma function) angularMath.sigma(min, max);
  • get the mul between integers min and max (pi function) angularMath.pi(min, max);
Math
  • get the cos value of a number angularMath.cosNumber(number);
  • get the sin value of a number angularMath.sinNumber(number);
  • get the tan value of a number angularMath.tanNumber(number);
  • get the acos value of a number angularMath.acosNumber(number);
  • get the asin value of a number angularMath.asinNumber(number);
  • get the atan value of a number angularMath.atanNumber(number);

Repository

License

MIT © Andrei Secareanu

Changelog

v2.0.0
  • fixed the issue;
  • the sum, dif, mul and div will return the correct value, rounded to 2 decimals;
  • typescript updated to the latest version;
v1.0.7
v1.0.6
  • add factorial functionality; - Number actions
  • convert number from decimal to binary; - Convert
  • convert number from decimal to octal; - Convert
  • convert number from decimal to hexadecimal; - Convert
v1.0.5
  • first release;