File tree Expand file tree Collapse file tree 2 files changed +17
-24
lines changed Expand file tree Collapse file tree 2 files changed +17
-24
lines changed Original file line number Diff line number Diff line change @@ -35,29 +35,6 @@ Defined as:
35
35
The C < :D > variant simply returns the invocant. The C < :U > variant issues a warning about using
36
36
an uninitialized value in numeric context and then returns C < self.new > .
37
37
38
- = head2 method Int
39
-
40
- method Int(Numeric:D: --> Int:D)
41
-
42
- If this C < Numeric > is equivalent to a C < Real > , return the equivalent of
43
- calling C < truncate > on that C < Real > to get an C < Int > . Fail with
44
- C < X::Numeric::Real > otherwise.
45
-
46
- = head2 method Rat
47
-
48
- method Rat(Numeric:D: Real $epsilon = 1.0e-6 --> Rat:D)
49
-
50
- If this C < Numeric > is equivalent to a C < Real > , return a C < Rat > which is
51
- within C < $epsilon > of that C < Real > 's value. Fail with C < X::Numeric::Real >
52
- otherwise.
53
-
54
- = head2 method Num
55
-
56
- method Num(Numeric:D: --> Num:D)
57
-
58
- If this C < Numeric > is equivalent to a C < Real > , return that C < Real > as a C < Num >
59
- as accurately as is possible. Fail with C < X::Numeric::Real > otherwise.
60
-
61
38
= head2 method narrow
62
39
63
40
method narrow(Numeric:D --> Numeric:D)
Original file line number Diff line number Diff line change @@ -68,11 +68,20 @@ it is an L<Int|/type/Int> when we instantiated C<Temperature> with an L<Int|/typ
68
68
Converts the number to a C < Complex > with the number converted to a C < Num > as
69
69
its real part and 0e0 as the imaginary part.
70
70
71
+ = head2 method Int
72
+
73
+ method Int(Real:D:)
74
+
75
+ Calls the L « C < Bridge > method|/routine/Bridge» on the invocant and then
76
+ calls the L « C < Int > method|/routine/Int» on its return value.
77
+
71
78
= head2 method Rat
72
79
73
80
method Rat(Real:D: Real $epsilon = 1e-6)
74
81
75
- Converts the number to a C < Rat > with the precision C < $epsilon > .
82
+ Calls the L « C < Bridge > method|/routine/Bridge» on the invocant and then
83
+ calls the L « C < Rat > method|/routine/Rat» on its return value with the
84
+ C < $epsilon > argument.
76
85
77
86
= head2 method Real
78
87
@@ -85,6 +94,13 @@ The C<:D> variant simply returns the invocant. The C<:U> variant issues a
85
94
warning about using an uninitialized value in numeric context and then returns
86
95
C < self.new > .
87
96
97
+ = head2 method Num
98
+
99
+ method Num(Real:D:)
100
+
101
+ Calls the L « C < Bridge > method|/routine/Bridge» on the invocant and then
102
+ calls the L « C < Num > method|/routine/Num» on its return value.
103
+
88
104
= head2 routine rand
89
105
90
106
sub term:<rand> (--> Num:D)
You can’t perform that action at this time.
0 commit comments