File tree Expand file tree Collapse file tree 6 files changed +6
-0
lines changed Expand file tree Collapse file tree 6 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ impl num of num for f32 {
184
184
fn mul ( & & other: f32 ) -> f32 { ret self * other; }
185
185
fn div ( & & other: f32 ) -> f32 { ret self / other; }
186
186
fn modulo ( & & other: f32 ) -> f32 { ret self % other; }
187
+ fn neg ( ) -> f32 { ret -self ; }
187
188
188
189
fn to_int ( ) -> int { ret self as int ; }
189
190
fn from_int ( n : int ) -> f32 { ret n as f32 ; }
Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ impl num of num for f64 {
205
205
fn mul ( & & other: f64 ) -> f64 { ret self * other; }
206
206
fn div ( & & other: f64 ) -> f64 { ret self / other; }
207
207
fn modulo ( & & other: f64 ) -> f64 { ret self % other; }
208
+ fn neg ( ) -> f64 { ret -self ; }
208
209
209
210
fn to_int ( ) -> int { ret self as int ; }
210
211
fn from_int ( n : int ) -> f64 { ret n as f64 ; }
Original file line number Diff line number Diff line change @@ -416,6 +416,7 @@ impl num of num for float {
416
416
fn mul ( & & other: float ) -> float { ret self * other; }
417
417
fn div ( & & other: float ) -> float { ret self / other; }
418
418
fn modulo ( & & other: float ) -> float { ret self % other; }
419
+ fn neg ( ) -> float { ret -self ; }
419
420
420
421
fn to_int ( ) -> int { ret self as int ; }
421
422
fn from_int ( n : int ) -> float { ret n as float ; }
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ impl num of num for T {
129
129
fn mul ( & & other: T ) -> T { ret self * other; }
130
130
fn div ( & & other: T ) -> T { ret self / other; }
131
131
fn modulo ( & & other: T ) -> T { ret self % other; }
132
+ fn neg ( ) -> T { ret -self ; }
132
133
133
134
fn to_int ( ) -> int { ret self as int ; }
134
135
fn from_int ( n : int ) -> T { ret n as T ; }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ iface num {
8
8
fn mul( & & other: self ) -> self ;
9
9
fn div( & & other: self ) -> self ;
10
10
fn modulo( & & other: self ) -> self ;
11
+ fn neg ( ) -> self ;
11
12
12
13
fn to_int ( ) -> int ;
13
14
fn from_int( n : int ) -> self ; // TODO: Static functions.
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ impl num of num for T {
70
70
fn mul ( & & other: T ) -> T { ret self * other; }
71
71
fn div ( & & other: T ) -> T { ret self / other; }
72
72
fn modulo ( & & other: T ) -> T { ret self % other; }
73
+ fn neg ( ) -> T { ret -self ; }
73
74
74
75
fn to_int ( ) -> int { ret self as int ; }
75
76
fn from_int ( n : int ) -> T { ret n as T ; }
You can’t perform that action at this time.
0 commit comments