Skip to content

Commit

Permalink
Added Integer>>#round to be polymorphic with Double
Browse files Browse the repository at this point in the history
This is useful because for instance #sqrt will return an Integer if the results fits into one (is this actually a good idea? Sounds strange when putting this here.)

Signed-off-by: Stefan Marr <git@stefan-marr.de>
  • Loading branch information
smarr committed Sep 30, 2015
1 parent 6e4e920 commit df8ca72
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Kernel.som
Expand Up @@ -167,6 +167,7 @@ class Kernel vmMirror: vmMirror = Object <: Value (
public abs = ( ^ (self < 0) ifTrue: (0 - self) ifFalse: self )
public sqrt = ( ^ vmMirror intSqrt: self )
public negated = ( ^ 0 - self )
public round = ( ^ self ) (* added to be polymorphic with Double *)

'Bit operations'
public & argument = ( ^ vmMirror int: self bitAnd: argument )
Expand Down

0 comments on commit df8ca72

Please sign in to comment.