Documentation

math.copysign() function

The math.copysign() function returns a value with the magnitude of x and the sign of y.

Output data type: Float

import "math"

math.copysign(x: 1.0, y: 2.0)

// Returns 1.0

Parameters

x

The magnitude used in the operation.

y

The sign used in the operation.


Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.