1Clownfish::Float(3pm) User Contributed Perl DocumentationClownfish::Float(3pm)
2
3
4
6 Clownfish::Float - Immutable double precision floating point number.
7
9 my $float = Clownfish::Float->new(2.5);
10 my $value = $float->get_value;
11
14 new
15 my $float = Clownfish::Float->new($value);
16
17 Return a new Float.
18
19 • value - Initial value.
20
22 get_value
23 my $result = $float->get_value();
24
25 Return the value of the Float.
26
27 to_i64
28 my $int = $float->to_i64();
29
30 Convert the Float to an integer, truncating toward zero. Throw an
31 exception if the value is out of the range of an "int64_t".
32
33 compare_to
34 my $int = $float->compare_to($other);
35
36 Indicate whether one number is less than, equal to, or greater than
37 another. Throws an exception if "other" is neither a Float nor an
38 Integer.
39
40 Returns: 0 if the numbers are equal, a negative number if "self" is
41 less than "other", and a positive number if "self" is greater than
42 "other".
43
44 clone
45 my $result = $float->clone();
46
47 Return a clone of the object.
48
50 Clownfish::Float isa Clownfish::Obj.
51
52
53
54perl v5.38.0 2023-07-20 Clownfish::Float(3pm)