'+=' etc for all floating point types

This commit is contained in:
Araq 2012-05-29 00:42:28 +02:00
commit b5d8e8bfaa
6 changed files with 21 additions and 13 deletions

View file

@ -2184,19 +2184,19 @@ proc `*=`*[T](x: var ordinal[T], y: ordinal[T]) {.inline, noSideEffect.} =
## Binary `*=` operator for ordinals
x = x * y
proc `+=` *(x: var float, y:float) {.inline, noSideEffect.} =
proc `+=`*[T: float|float32|float64] (x: var T, y: T) {.inline, noSideEffect.} =
## Increments in placee a floating point number
x = x + y
proc `-=` *(x: var float, y:float) {.inline, noSideEffect.} =
proc `-=`*[T: float|float32|float64] (x: var T, y: T) {.inline, noSideEffect.} =
## Decrements in place a floating point number
x = x - y
proc `*=` *(x: var float, y:float) {.inline, noSideEffect.} =
proc `*=`*[T: float|float32|float64] (x: var T, y: T) {.inline, noSideEffect.} =
## Multiplies in place a floating point number
x = x * y
proc `/=` *(x: var float, y:float) {.inline, noSideEffect.} =
proc `/=`*[T: float|float32|float64] (x: var T, y: T) {.inline, noSideEffect.} =
## Divides in place a floating point number
x = x / y