package RakuAST::NumLiteral
class RakuAST::NumLiteral { }
The RakuAST::NumLiteral class represents a literal integer value (such
as `42e0`).
Object introspection
RakuAST::NumLiteral objects are typically created when parsing Raku
Programming Language code. So most developers will only need to know
how to introspect the objects created.
These introspection methods are available (in alphabetical order):
value
say $literal.value;
The value method returns the value it is representing.
Object creation
There is one way to create a RakuAST::NumLiteral object directly
(rather than having RakuAST::Literal.from-value figure it out):
new
my $literal = RakuAST::NumLiteral.new(42e0);
say $literal.^name; # RakuAST::NumLiteral
Creates a RakuAST::NumLiteral object from the given value.
Assumes the value is really a floating point value, does not do
any sanity checks.