typelevel / spire

Powerful new number types and numeric abstractions for Scala.
http://typelevel.org/spire/
MIT License
1.76k stars 243 forks source link

Make `NRoot` more formal #741

Open denisrosset opened 6 years ago

denisrosset commented 6 years ago

Currently, it is not clear whether NRoot provides n-th roots, polynomial root-finding (not present), or arbitrary powers (present, but unimplemented for Algebraic = throws).

erikerlandson commented 2 years ago

Would be interested in having NRoot make it's way into algebra, with some laws, or at least a concept truncating vs non-truncating types, similar to / vs tquot

maybe pow vs tpow. I imagine you could define fpow for "floor of power" but I'm only interested in tpow

I'm told that only BigInt is lawfully tquot and Int and Long are not. If Int and Long need ally-cats support I'd like that

FWIW my use cases on coulomb need v.pow(r) or v.tpow(r) where r is rational, so either supporting v.pow(<double>) and v.tpow(<double>), or pow(<int>) and root(<int>) would be sufficient