'+=' etc for all floating point types
This commit is contained in:
parent
f3980eb24a
commit
b5d8e8bfaa
6 changed files with 21 additions and 13 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue