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

Zero-cost rational numbers for Dart

q provides zero-cost rational numbers for Dart through an extension type.

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 half1 = Q(1, 2);
const half2 = Q(2, 4);

print(half1.asDouble); // 0.5
print(half1 == half2); // true
0
likes
140
points
26
downloads

Publisher

verified publishermateusfccp.me

Weekly Downloads

Zero-cost rational numbers for Dart

Repository (GitHub)

Documentation

API reference

License

MIT (license)

More

Packages that depend on q