Add signum.
This commit is contained in:
parent
75a318c567
commit
44b60114a1
|
@ -49,3 +49,10 @@ struct Tuple(*T)
|
||||||
{ self[0]//gcd, self[1]//gcd}
|
{ self[0]//gcd, self[1]//gcd}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
struct Number
|
||||||
|
def signum
|
||||||
|
return 0 if self == 0
|
||||||
|
self // self.abs
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user