q 0.0.0 copy "q: ^0.0.0" to clipboard
q: ^0.0.0 copied to clipboard

q

Features #

  • Provides an rational number zero-cost object that may be passed along.
  • Whenever you see Q, it's guaranteed to be a rational number.

Usage #

const half = Q(1, 2);
const half2 = Q(2, 4);

print(half.asDouble); // 0.5
print(half == half2); // true
print(half.toFractionString()); // 1/2
print(half2.toFractionString()); // 2/4
copied to clipboard
0
likes
140
points
33
downloads

Publisher

verified publishermateusfccp.me

Weekly Downloads

2024.08.15 - 2025.02.27

q

Repository (GitHub)

Documentation

API reference

License

MIT (license)

More

Packages that depend on q