1Clownfish::Float(3) User Contributed Perl Documentation Clownfish::Float(3)
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.32.0 2020-07-28 Clownfish::Float(3)