/* * Copyright 2020 Esben Bjerre * * Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE.md file. */////// Trait for types that support negation, and its functions.///pubmod Neg {////// Trait for types that support negation.///pubtraitNeg[a] {////// Returns -`x`.///pubdefneg(x: a): a }instanceNeg[Float32] {pubdefneg(x: Float32): Float32 = %%FLOAT32_NEG%%(x) }instanceNeg[Float64] {pubdefneg(x: Float64): Float64 = %%FLOAT64_NEG%%(x) }instanceNeg[BigDecimal] {pubdefneg(x: BigDecimal): BigDecimal = x.negate() }instanceNeg[Int8] {pubdefneg(x: Int8): Int8 = %%INT8_NEG%%(x) }instanceNeg[Int16] {pubdefneg(x: Int16): Int16 = %%INT16_NEG%%(x) }instanceNeg[Int32] {pubdefneg(x: Int32): Int32 = %%INT32_NEG%%(x) }instanceNeg[Int64] {pubdefneg(x: Int64): Int64 = %%INT64_NEG%%(x) }instanceNeg[BigInt] {pubdefneg(x: BigInt): BigInt = x.negate() }}