/
asias
/
new
Обзор
Документация
Войти
/
asias
/
new
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
new
/
node_modules
/
fraction.js
/
..
dist
project
8 месяцев назад
examples
project
8 месяцев назад
src
project
8 месяцев назад
tests
project
8 месяцев назад
CHANGELOG.md
project
8 месяцев назад
LICENSE
project
8 месяцев назад
README.md
project
8 месяцев назад
fraction.d.mts
project
8 месяцев назад
fraction.d.ts
project
8 месяцев назад
package.json
project
8 месяцев назад
Fraction.js - ℚ in JavaScript
Convert Decimal to Fraction
Precision
Examples / Motivation
Laplace Probability
P({3}):
P({1, 4}):
P({2, 4, 6}):
Convert degrees/minutes/seconds to precise rational representation:
Rational approximation of irrational numbers
Get the exact fractional part of a number
Mathematical correct modulo
Parser
Arrays / Objects
Integers
Doubles
Strings
Two arguments
Repeating decimal places
Attributes
Functions
Fraction abs()
Fraction neg()
Fraction add(n)
Fraction sub(n)
Fraction mul(n)
Fraction div(n)
Fraction pow(exp)
Fraction log(base)
Fraction mod(n)
Fraction mod()
Fraction gcd(n)
Fraction lcm(n)
Fraction ceil([places=0-16])
Fraction floor([places=0-16])
Fraction round([places=0-16])
Fraction roundTo(multiple)
Fraction inverse()
Fraction simplify([eps=0.001])
boolean equals(n)
boolean lt(n)
boolean lte(n)
boolean gt(n)
boolean gte(n)
int compare(n)
boolean divisible(n)
double valueOf()
String toString([decimalPlaces=15])
String toLatex(showMixed=false)
String toFraction(showMixed=false)
Array toContinued()
Fraction clone()
Exceptions
Installation
Usage
Coding Style
Building the library
Run a test
Copyright and Licensing
README.md