Back to Influxdb

bitwise.uor() function

content/flux/v0/stdlib/experimental/bitwise/uor.md

latest3.6 KB
Original Source
<!------------------------------------------------------------------------------ IMPORTANT: This page was generated from comments in the Flux source code. Any edits made directly to this page will be overwritten the next time the documentation is generated. To make updates to this documentation, update the function comments above the function definition in the Flux source code: https://github.com/influxdata/flux/blob/master/stdlib/experimental/bitwise/bitwise.flux#L78-L78 Contributing to Flux: https://github.com/influxdata/flux#contributing Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md ------------------------------------------------------------------------------->

bitwise.uor() performs the bitwise operation, a OR b, with unsigned integers.

{{% warn %}}

Deprecated

Experimental bitwise.uor is deprecated in favor of bitwise.uor. {{% /warn %}}

Function type signature
js
(a: uint, b: uint) => uint

{{% caption %}} For more information, see Function type signatures. {{% /caption %}}

Parameters

a

({{< req >}}) Left hand operand.

b

({{< req >}}) Right hand operand.

Examples

Perform a bitwise OR operation

js
import "experimental/bitwise"

bitwise.uor(a: uint(v: 1234), b: uint(v: 4567))// Returns 5591 (uint)


Perform a bitwise OR operation on a stream of tables

js
import "experimental/bitwise"
import "sampledata"

sampledata.uint()
    |> map(fn: (r) => ({r with _value: bitwise.uor(a: r._value, b: uint(v: 3))}))

{{< expand-wrapper >}} {{% expand "View example input and output" %}}

Input data

_time_value*tag
2021-01-01T00:00:00Z18446744073709551614t1
2021-01-01T00:00:10Z10t1
2021-01-01T00:00:20Z7t1
2021-01-01T00:00:30Z17t1
2021-01-01T00:00:40Z15t1
2021-01-01T00:00:50Z4t1
_time_value*tag
2021-01-01T00:00:00Z19t2
2021-01-01T00:00:10Z4t2
2021-01-01T00:00:20Z18446744073709551613t2
2021-01-01T00:00:30Z19t2
2021-01-01T00:00:40Z13t2
2021-01-01T00:00:50Z1t2

Output data

_time_value*tag
2021-01-01T00:00:00Z18446744073709551615t1
2021-01-01T00:00:10Z11t1
2021-01-01T00:00:20Z7t1
2021-01-01T00:00:30Z19t1
2021-01-01T00:00:40Z15t1
2021-01-01T00:00:50Z7t1
_time_value*tag
2021-01-01T00:00:00Z19t2
2021-01-01T00:00:10Z7t2
2021-01-01T00:00:20Z18446744073709551615t2
2021-01-01T00:00:30Z19t2
2021-01-01T00:00:40Z15t2
2021-01-01T00:00:50Z3t2

{{% /expand %}} {{< /expand-wrapper >}}