_Number

it.grypho.scala.leonardo.core._Number
See the_Number companion object
case class _Number(d: Double) extends _Value

Concrete real scalar value.

Rounding is a display concern only: toString and display round for output; eval propagates the stored Double as-is. ±∞ serialises as "inf" / "-inf" for round-trip safety through the parser.

Value parameters

d

the exact double-precision value

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait _Value
trait _Expression
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def children: List[_Expression]

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Sub-expressions subject to recursive structural traversal. Binder positions (e.g. the differentiation variable) are excluded.

Attributes

Definition Classes
def display(precision: Int): String

Renders this number at precision decimal places for REPL display.

Renders this number at precision decimal places for REPL display.

Value parameters

precision

number of decimal places to show

Attributes

override def eval(env: Environment): Either[_Expression, _Value]

Returns Right(this) — a concrete number needs no further reduction.

Returns Right(this) — a concrete number needs no further reduction.

Attributes

Definition Classes
override def rebuild(c: List[_Expression]): _Expression

Reconstructs the same node shape with replacement sub-expressions.

Reconstructs the same node shape with replacement sub-expressions.

Value parameters

newChildren

replacements in the same order and count as children

Attributes

Definition Classes
override def toString: String

Renders this number at Environment.DefaultPrecision decimal places. ±∞ renders as "inf" / "-inf" for round-trip safety.

Renders this number at Environment.DefaultPrecision decimal places. ±∞ renders as "inf" / "-inf" for round-trip safety.

Attributes

Definition Classes
Any

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Inherited fields

lazy val freeVars: Set[String]

Cached set of free variable names; O(1) after the first access.

Cached set of free variable names; O(1) after the first access.

Attributes

Inherited from:
_Expression