trait
NRoot[A] extends Any
Abstract Value Members
-
abstract
def
fpow(a: A, b: A): A
-
abstract
def
getClass(): Class[_]
-
abstract
def
nroot(a: A, n: Int): A
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
equals(arg0: Any): Boolean
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
def
sqrt(a: A): A
-
def
toString(): String
This is a type class for types with n-roots. The value returned by
nroot
andsqrt
are only guaranteed to be approximate answers (except in the case ofReal
).Also, generally
nroot
s wheren
is even are not defined for negative numbers. The behaviour is undefined if this is attempted. It would be nice to ensure an exception is raised, but some types may defer computation and testing if a value is negative may not be ideal. So, do not count onArithmeticException
s to save you from bad arithmetic!