Name
SPVM::Float - A float value as An Object
Description
Float class in SPVM represents a float value as an object.
Usage
my $float_object = Float->new(5.0f);
my $float_value = $float_object->value;
$float_object->set_value(10.0f);
Details
This class is automatically loaded.
Interfaces
Stringable =item * Cloneable
Fields
value
has value : rw float;
The value. If the "is_read_only" field is 1, a compilation error or a runtime error occurs when setting the value.
is_read_only
has is_read_only : ro byte;
If this value is 1, the "value" field is read-only.
Class Methods
new
static method new : Float ($value : float);
Creates a new Float object with a float $value.
Instance Methods
make_read_only
method make_read_only : void ();
Sets "is_read_only" field to 1.
clone
method clone : Float ();
Creates a new Float object that clones this object. The value of "is_read_only" field in the new object is 0.
to_string
method to_string : string ();
Casts the value to string type and returns it.
Copyright & License
Copyright (c) 2023 Yuki Kimoto
MIT License