ConstantKind

it.grypho.scala.leonardo.core.ConstantKind
enum ConstantKind(val keyword: String, val glyph: Option[String], val value: Double) extends Keyworded

The named mathematical constants (F_0289).

pi and e were folded to numbers by the parser until F_0289; eulergamma and goldenratio are new. gamma and phi stay free variable names (phi is the spherical coordinate, and a released name cannot be reclaimed without breaking saved scripts), so the two new constants are spelled out, with the Greek glyphs accepted as aliases — the ASCII name is what is printed and saved.

Value parameters

glyph

a Greek alias the grammar also reads, if any

keyword

the word the grammar reads and toString writes

value

the constant as a Double

Attributes

Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
trait Keyworded
class Object
trait Matchable
class Any
Show all

Members list

Type members

Enum entries

case E extends ConstantKind

Euler's number, the base of the natural logarithm.

Euler's number, the base of the natural logarithm.

Attributes

case EulerGamma extends ConstantKind

The Euler–Mascheroni constant γ = lim (Hₙ − ln n).

The Euler–Mascheroni constant γ = lim (Hₙ − ln n).

Attributes

case GoldenRatio extends ConstantKind

The golden ratio φ = (1 + √5)/2.

The golden ratio φ = (1 + √5)/2.

Attributes

case Pi extends ConstantKind

The circle constant π.

The circle constant π.

Attributes