Takeable

com.phasmidsoftware.number.core.misc.Takeable
trait Takeable

This trait is, essentially, a subset of IterableOnce.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ConFrac

Members list

Value members

Abstract methods

def take(n: Int): Takeable

Method to convert an infinite continued fraction into a finite continued fraction.

Method to convert an infinite continued fraction into a finite continued fraction.

Value parameters

n

the number of elements to take.

Attributes

Returns

a Takeable which starts out the same as this, but after n elements, the tail (co) will be None.

def takeWhile(p: Rational => Boolean): Takeable

Method to convert an infinite continued fraction into a finite continued fraction.

Method to convert an infinite continued fraction into a finite continued fraction.

Value parameters

p

the predicate which operates on the current rational approximation, such that, as long as true is returned, we continue to take elements.

Attributes

Returns

a Takeable which starts out the same as this but, once the predicate has failed on this, the tail (co) will be None.