Skip to content

class Crystal::NumberLiteral
inherits Crystal::ASTNode

Any number literal. kind stores a symbol indicating which type is it: i32, u16, f32, f64, etc.

Class methods

.kind_from_number(number : Number)

View source

.new(value : String, kind = :i32)

View source

.new(value : Number)

View source

Methods

#==(other : self)

Returns true if this reference is the same as other. Invokes same?.

View source

#bin_op

View source

#bool_bin_op

View source

#can_be_autocast_to?(other_type)

View source

#clone_without_location

View source

#has_sign?

View source

#hash(hasher)

View source

#int_bin_op

View source

#integer_value

View source

#interpret(method : String, args : Array(ASTNode), named_args : Hash(String, ASTNode)?, block : Crystal::Block?, interpreter : Crystal::MacroInterpreter, name_loc : Location?)

View source

#interpret_compare(other : NumberLiteral)

View source

#kind=(kind : Symbol)

View source

#num_bin_op

View source

#to_number

View source

#value : String

View source

#value=(value : String)

View source

#zero?

View source