docs-v2/content/influxdb/cloud/reference/flux/stdlib/math/copysign.md

639 B

title description aliases menu weight
math.copysign() function The math.copysign() function returns a value with the magnitude of `x` and the sign of `y`.
/influxdb/cloud/reference/flux/functions/math/copysign/
influxdb_cloud_ref
name parent
math.copysign Math
301

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.

Data type: Float

y

The sign used in the operation.

Data type: Float