blib/lib/SPVM/Float.pm untested

filter: Statementstmt n/a Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a SCAR -
1 package SPVM::Float;
2  
3 1;
4  
5 =head1 Name
6  
7 SPVM::Float - A float value as An Object
8  
9 =head1 Description
10  
11 Float class in L<SPVM> represents a float value as an object.
12  
13 =head1 Usage
14
15 my $float_object = Float->new(5.0f);
16 my $float_value = $float_object->value;
17 $float_object->set_value(10.0f);
18  
19 =head1 Details
20  
21 This class is automatically loaded.
22  
23 =head1 Interfaces
24  
25 =over 2
26  
27 =item * L<Stringable|SPVM::Stringable>
28 =item * L<Cloneable|SPVM::Cloneable>
29  
30 =back
31  
32 =head1 Fields
33  
34 =head2 value
35  
36 C<has value : rw float;>
37  
38 The value. If the L</"is_read_only"> field is 1, a compilation error or a runtime error occurs when setting the value.
39  
40 =head2 is_read_only
41  
42 C<has is_read_only : ro byte;>
43  
44 If this value is 1, the L</"value"> field is read-only.
45  
46 =head1 Class Methods
47  
48 =head2 new
49  
50 C<static method new : L<Float|SPVM::Float> ($value : float);>
51  
52 Creates a new L<Float|SPVM::Float> object with a C<float> $value.
53  
54 =head1 Instance Methods
55  
56 =head2 make_read_only
57  
58 C<method make_read_only : void ();>
59  
60 Sets L</"is_read_only"> field to 1.
61  
62 =head2 clone
63  
64 C<method clone : L<Float|SPVM::Float> ();>
65  
66 Creates a new L<Float|SPVM::Float> object that clones this object. The value of L</"is_read_only"> field in the new object is 0.
67  
68 =head2 to_string
69  
70 C<method to_string : string ();>
71  
72 Casts the value to string type and returns it.
73  
74 =head1 Copyright & License
75  
76 Copyright (c) 2023 Yuki Kimoto
77  
78 MIT License