nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
05cea22
)
lib: add nitunits to Numeric::value_of
author
Alexis Laferrière
<alexis.laf@xymus.net>
Fri, 23 May 2014 15:26:15 +0000
(11:26 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Wed, 28 May 2014 17:33:39 +0000
(13:33 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/standard/kernel.nit
patch
|
blob
|
history
diff --git
a/lib/standard/kernel.nit
b/lib/standard/kernel.nit
index
596342c
..
f54cd2f
100644
(file)
--- a/
lib/standard/kernel.nit
+++ b/
lib/standard/kernel.nit
@@
-241,6
+241,11
@@
interface Numeric
fun zero: OTHER is abstract
# The value of `val` in the domain of `self`
+ #
+ # assert 1.0.value_of(2) == 2.0
+ # assert 1.0.value_of(2.0) == 2.0
+ # assert 1.value_of(2) == 2
+ # assert 1.value_of(2.0) == 2
fun value_of(val: Numeric): OTHER is abstract
end