---
title: "Arithmetic"
description: "Aerospike documentation for arithmetic expression operators, covering numeric math and integer bitwise operations."
---

# Arithmetic

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

Arithmetic expressions compute **numeric** results—integers or floats—from bins, constants, and nested expressions. Use them in **read/write operation expressions** (for example projection or computed writes), inside **comparison** expressions when you need a derived value on the left or right, and anywhere the client API accepts a numeric expression.

Operators include **`add`**, **`sub`**, **`mul`**, **`div`**, **`pow`**, **`log`**, **`mod`**, **`abs`**, **`floor`**, **`ceil`**, **`min`**, **`max`**, **`to_int`**, **`to_float`**, and **integer bitwise** helpers (**`int_and`**, **`int_or`**, **`int_xor`**, **`int_not`**, shifts, **`int_count`**, **`int_lscan`**, **`int_rscan`**). Operand types must match the operator (for example, **`pow`** and **`log`** use floats; **bitwise** ops use integers). Needs server **5.6.0+** for these ops unless noted otherwise in each operation.

For **boolean** filters on records (true/false/unknown), wrap numeric results in a [comparison](https://aerospike.com/docs/develop/expressions/comparison) or combine with [logic](https://aerospike.com/docs/develop/expressions/logic) expressions. Nested document scenarios often compose arithmetic with [path](https://aerospike.com/docs/develop/expressions/path/) or [map/list](https://aerospike.com/docs/develop/expressions/map-bin/) expressions.

## Ops

#### `abs`

```python
abs(value)
```

Description: Creates an absolute-value operator that returns the absolute value of a number. The argument must be either an ‘integer\_expr’ or a ‘float\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `value` | `number_expr` |

Returns: `number_value`

Introduced: 5.6.0

Example: Find records where the absolute value of the difference between integer bins `x1` and `x2` is greater than 1.

-   [Java](#tab-panel-721)
-   [Python](#tab-panel-722)
-   [C](#tab-panel-723)
-   [Go](#tab-panel-724)
-   [C#](#tab-panel-725)
-   [Node.js](#tab-panel-726)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.abs(Exp.sub(

      Exp.intBin("x1"), Exp.intBin("x2"))),

    Exp.val(1)));
```

```python
from aerospike_helpers.expressions import Abs, GT, IntBin, Sub

exp = GT(Abs(Sub(IntBin("x1"), IntBin("x2"))), 1).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_abs(as_exp_sub(

      as_exp_bin_int("x1"), as_exp_bin_int("x2"))),

    as_exp_int(1)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpNumAbs(as.ExpNumSub(as.ExpIntBin("x1"), as.ExpIntBin("x2"))),

  as.ExpIntVal(1))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.Abs(Exp.Sub(Exp.IntBin("x1"), Exp.IntBin("x2"))),

    Exp.Val(1)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(

  exp.abs(exp.sub(exp.binInt('x1'), exp.binInt('x2'))),

  exp.int(1))
```

---

#### `add`

```python
add(arg0, arg1, ...)
```

Description: Creates an addition (+) operator that applies to a variable number of expression arguments. Arguments must all be either ‘float\_expr’ or ‘integer\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `number_expr` |
| `arg1` | `number_expr` |
| `...` | `number_expr` |

Returns: `number_value`

Introduced: 5.6.0

Example: Find records where the sum of integer bins `apples` and `bananas` is greater than 10.

-   [Java](#tab-panel-727)
-   [Python](#tab-panel-728)
-   [C](#tab-panel-729)
-   [Go](#tab-panel-730)
-   [C#](#tab-panel-731)
-   [Node.js](#tab-panel-732)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.add(

      Exp.intBin("apples"),

      Exp.intBin("bananas")),

    Exp.val(10)));
```

```python
from aerospike_helpers.expressions import Add, GT, IntBin

exp = GT(Add(IntBin("apples"), IntBin("bananas")), 10).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_add(

      as_exp_bin_int("apples"),

      as_exp_bin_int("bananas")),

    as_exp_int(10)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpNumAdd(as.ExpIntBin("apples"), as.ExpIntBin("bananas")),

  as.ExpIntVal(10))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.Add(Exp.IntBin("apples"), Exp.IntBin("bananas")),

    Exp.Val(10)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(

  exp.add(exp.binInt('apples'), exp.binInt('bananas')),

  exp.int(10))
```

---

#### `ceil`

```python
ceil(value)
```

Description: Creates an expression that rounds a floating-point number up to the closest integer value. The argument must be a ‘float\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `value` | `float_expr` |

Returns: `float_value`

Introduced: 5.6.0

Example: Find records where the ceiling of float bin `value` equals 2.0.

-   [Java](#tab-panel-733)
-   [Python](#tab-panel-734)
-   [C](#tab-panel-735)
-   [Go](#tab-panel-736)
-   [C#](#tab-panel-737)
-   [Node.js](#tab-panel-738)

```java
Expression exp = Exp.build(

  Exp.eq(

    Exp.ceil(Exp.floatBin("value")),

    Exp.val(2.0)));
```

```python
from aerospike_helpers.expressions import Ceil, Eq, FloatBin

exp = Eq(Ceil(FloatBin("value")), 2.0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_eq(

    as_exp_ceil(as_exp_bin_float("value")),

    as_exp_float(2.0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpEq(

  as.ExpNumCeil(as.ExpFloatBin("value")),

  as.ExpFloatVal(2.0))
```

```csharp
Expression exp = Exp.Build(

  Exp.EQ(

    Exp.Ceil(Exp.FloatBin("value")),

    Exp.Val(2.0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.eq(exp.ceil(exp.binFloat('value')), exp.float(2.0))
```

---

#### `div`

```python
div(arg0, arg1, ...)
```

Description: Creates a division operator (/) that applies to a variable number of expression arguments. Divides arguments from left to right, such that div(10,5) equals (10/5) and div(10,5,2) equals (10 / (5 \* 2)), or, in alternate notation, ((10 / 5) / 2). If only one argument is supplied, returns the reciprocal (1/x) for that argument or, if the single argument is an integer type, returns 0 to avoid type incompatibility (as the reciprocal of an integer is a fraction). Arguments must all be either ‘float\_expr’ or ‘integer\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `number_expr` |
| `arg1` | `number_expr` |
| `...` | `number_expr` |

Returns: `number_value`

Introduced: 5.6.0

Example: Find records where `candy` divided by `kids` (as floats) is less than 1.0.

-   [Java](#tab-panel-739)
-   [Python](#tab-panel-740)
-   [C](#tab-panel-741)
-   [Go](#tab-panel-742)
-   [C#](#tab-panel-743)
-   [Node.js](#tab-panel-744)

```java
Expression exp = Exp.build(

  Exp.lt(

    Exp.div(

      Exp.toFloat(Exp.intBin("candy")),

      Exp.toFloat(Exp.intBin("kids"))),

    Exp.val(1.0)));
```

```python
from aerospike_helpers.expressions import Div, FloatBin, IntBin, LT, ToFloat

exp = LT(

    Div(ToFloat(IntBin("candy")), ToFloat(IntBin("kids"))),

    1.0,

).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_lt(

    as_exp_div(

      as_exp_to_float(as_exp_bin_int("candy")),

      as_exp_to_float(as_exp_bin_int("kids"))),

    as_exp_float(1.0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpLess(

  as.ExpNumDiv(as.ExpToFloat(as.ExpIntBin("candy")), as.ExpToFloat(as.ExpIntBin("kids"))),

  as.ExpFloatVal(1.0))
```

```csharp
Expression exp = Exp.Build(

  Exp.LT(

    Exp.Div(Exp.ToFloat(Exp.IntBin("candy")), Exp.ToFloat(Exp.IntBin("kids"))),

    Exp.Val(1.0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.lt(

  exp.div(exp.toFloat(exp.binInt('candy')), exp.toFloat(exp.binInt('kids'))),

  exp.float(1.0))
```

---

#### `floor`

```python
floor(value)
```

Description: Creates an expression that rounds a floating-point number down to the closest integer value. The argument must be a ‘float\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `value` | `float_expr` |

Returns: `float_value`

Introduced: 5.6.0

Example: Find records where the floor of float bin `value` equals 2.0.

-   [Java](#tab-panel-745)
-   [Python](#tab-panel-746)
-   [C](#tab-panel-747)
-   [Go](#tab-panel-748)
-   [C#](#tab-panel-749)
-   [Node.js](#tab-panel-750)

```java
Expression exp = Exp.build(

  Exp.eq(

    Exp.floor(Exp.floatBin("value")),

    Exp.val(2.0)));
```

```python
from aerospike_helpers.expressions import Eq, FloatBin, Floor

exp = Eq(Floor(FloatBin("value")), 2.0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_eq(

    as_exp_floor(as_exp_bin_float("value")),

    as_exp_float(2.0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpEq(

  as.ExpNumFloor(as.ExpFloatBin("value")),

  as.ExpFloatVal(2.0))
```

```csharp
Expression exp = Exp.Build(

  Exp.EQ(

    Exp.Floor(Exp.FloatBin("value")),

    Exp.Val(2.0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.eq(exp.floor(exp.binFloat('value')), exp.float(2.0))
```

---

#### `int_and`

```python
int_and(arg0, arg1, ...)
```

Description: Creates an “and” operator (&) that is applied to two or more integers. All arguments must resolve to integers.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `integer_expr` |
| `arg1` | `integer_expr` |
| `...` | `integer_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where integer bin `flags` bitwise-AND mask `0xF` is non-zero.

-   [Java](#tab-panel-751)
-   [Python](#tab-panel-752)
-   [C](#tab-panel-753)
-   [Go](#tab-panel-754)
-   [C#](#tab-panel-755)
-   [Node.js](#tab-panel-756)

```java
Expression exp = Exp.build(

  Exp.ne(

    Exp.intAnd(Exp.intBin("flags"), Exp.val(0xF)),

    Exp.val(0)));
```

```python
from aerospike_helpers.expressions import IntAnd, IntBin, NE

exp = NE(IntAnd(IntBin("flags"), 0xF), 0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_ne(

    as_exp_int_and(as_exp_bin_int("flags"), as_exp_int(0xF)),

    as_exp_int(0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpNotEq(

  as.ExpIntAnd(as.ExpIntBin("flags"), as.ExpIntVal(0xF)),

  as.ExpIntVal(0))
```

```csharp
Expression exp = Exp.Build(

  Exp.NE(

    Exp.IntAnd(Exp.IntBin("flags"), Exp.Val(0xF)),

    Exp.Val(0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.ne(

  exp.intAnd(exp.binInt('flags'), exp.int(0xf)),

  exp.int(0))
```

---

#### `int_arshift`

```python
int_arshift(value, by_numbits)
```

Description: Creates an arithmetic right-shift operator (>>) for use with integers.

Arguments: | Name | Type |
| --- | --- |
| `value` | `integer_expr` |
| `by_numbits` | `integer_value` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where arithmetic right-shift of integer bin `value` by 3 bits (divide by 8) is less than 1000.

-   [Java](#tab-panel-757)
-   [Python](#tab-panel-758)
-   [C](#tab-panel-759)
-   [Go](#tab-panel-760)
-   [C#](#tab-panel-761)
-   [Node.js](#tab-panel-762)

```java
Expression exp = Exp.build(

  Exp.lt(

    Exp.arshift(Exp.intBin("value"), Exp.val(3)),

    Exp.val(1000)));
```

```python
from aerospike_helpers.expressions import IntArithmeticRightShift, IntBin, LT

exp = LT(IntArithmeticRightShift(IntBin("value"), 3), 1000).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_lt(

    as_exp_int_arshift(as_exp_bin_int("value"), as_exp_int(3)),

    as_exp_int(1000)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpLess(

  as.ExpIntARShift(as.ExpIntBin("value"), as.ExpIntVal(3)),

  as.ExpIntVal(1000))
```

```csharp
Expression exp = Exp.Build(

  Exp.LT(

    Exp.ARshift(Exp.IntBin("value"), Exp.Val(3)),

    Exp.Val(1000)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.lt(

  exp.intArshift(exp.binInt('value'), exp.int(3)),

  exp.int(1000))
```

---

#### `int_count`

```python
int_count(value)
```

Description: Creates an expression that returns a count of integer bits that are set to 1.

Arguments: | Name | Type |
| --- | --- |
| `value` | `integer_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where the population count of integer bin `visits` is greater than 15.

-   [Java](#tab-panel-763)
-   [Python](#tab-panel-764)
-   [C](#tab-panel-765)
-   [Go](#tab-panel-766)
-   [C#](#tab-panel-767)
-   [Node.js](#tab-panel-768)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.count(Exp.intBin("visits")),

    Exp.val(15)));
```

```python
from aerospike_helpers.expressions import GT, IntBin, IntCount

exp = GT(IntCount(IntBin("visits")), 15).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_int_count(as_exp_bin_int("visits")),

    as_exp_int(15)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpIntCount(as.ExpIntBin("visits")),

  as.ExpIntVal(15))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.Count(Exp.IntBin("visits")),

    Exp.Val(15)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(exp.intCount(exp.binInt('visits')), exp.int(15))
```

---

#### `int_lscan`

```python
int_lscan(value, search)
```

Description: Creates an expression that scans integer bits from the left (the most significant bit) to the right (the least significant bit), looking for a bit value. When the value is found, the index of that bit (where the most significant bit is index 0) is returned. If “search” is true, the scan searches for the bit value 1. If “search” is false, it searches for the bit value 0.

Arguments: | Name | Type |
| --- | --- |
| `value` | `integer_expr` |
| `search` | `boolean_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where a left-scan for bit 0 in integer bin `value` reports an index greater than 30 (leading bits mostly clear).

-   [Java](#tab-panel-769)
-   [Python](#tab-panel-770)
-   [C](#tab-panel-771)
-   [Go](#tab-panel-772)
-   [C#](#tab-panel-773)
-   [Node.js](#tab-panel-774)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.lscan(Exp.intBin("value"), Exp.val(false)),

    Exp.val(30)));
```

```python
from aerospike_helpers.expressions import GT, IntBin, IntLeftScan

exp = GT(IntLeftScan(IntBin("value"), False), 30).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_int_lscan(

      as_exp_bin_int("value"), as_exp_bool(false)),

    as_exp_int(30)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpIntLScan(as.ExpIntBin("value"), as.ExpBoolVal(false)),

  as.ExpIntVal(30))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.Lscan(Exp.IntBin("value"), Exp.Val(false)),

    Exp.Val(30)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(

  exp.intLscan(exp.binInt('value'), exp.bool(false)),

  exp.int(30))
```

---

#### `int_lshift`

```python
int_lshift(value, by_numbits)
```

Description: Creates a left-shift operator (<<) for use with integers.

Arguments: | Name | Type |
| --- | --- |
| `value` | `integer_expr` |
| `by_numbits` | `integer_value` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where integer bin `visits` left-shifted by 1 bit is greater than 100.

-   [Java](#tab-panel-775)
-   [Python](#tab-panel-776)
-   [C](#tab-panel-777)
-   [Go](#tab-panel-778)
-   [C#](#tab-panel-779)
-   [Node.js](#tab-panel-780)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.lshift(Exp.intBin("visits"), Exp.val(1)),

    Exp.val(100)));
```

```python
from aerospike_helpers.expressions import GT, IntBin, IntLeftShift

exp = GT(IntLeftShift(IntBin("visits"), 1), 100).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_int_lshift(as_exp_bin_int("visits"), as_exp_int(1)),

    as_exp_int(100)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpIntLShift(as.ExpIntBin("visits"), as.ExpIntVal(1)),

  as.ExpIntVal(100))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.Lshift(Exp.IntBin("visits"), Exp.Val(1)),

    Exp.Val(100)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(

  exp.intLshift(exp.binInt('visits'), exp.int(1)),

  exp.int(100))
```

---

#### `int_not`

```python
int_not(value)
```

Description: Creates a “not” operator (~) that is applied to an integer.

Arguments: | Name | Type |
| --- | --- |
| `value` | `integer_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where bitwise NOT of integer bin `flags` is not zero.

-   [Java](#tab-panel-781)
-   [Python](#tab-panel-782)
-   [C](#tab-panel-783)
-   [Go](#tab-panel-784)
-   [C#](#tab-panel-785)
-   [Node.js](#tab-panel-786)

```java
Expression exp = Exp.build(

  Exp.ne(

    Exp.intNot(Exp.intBin("flags")),

    Exp.val(0)));
```

```python
from aerospike_helpers.expressions import IntBin, IntNot, NE

exp = NE(IntNot(IntBin("flags")), 0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_ne(

    as_exp_int_not(as_exp_bin_int("flags")),

    as_exp_int(0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpNotEq(

  as.ExpIntNot(as.ExpIntBin("flags")),

  as.ExpIntVal(0))
```

```csharp
Expression exp = Exp.Build(

  Exp.NE(

    Exp.IntNot(Exp.IntBin("flags")),

    Exp.Val(0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.ne(exp.intNot(exp.binInt('flags')), exp.int(0))
```

---

#### `int_or`

```python
int_or(arg0, arg1, ...)
```

Description: Creates an “or” operator (|) that is applied to two or more integers. All arguments must resolve to integers.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `integer_expr` |
| `arg1` | `integer_expr` |
| `...` | `integer_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where the bitwise OR of integer bins `read_mask` and `write_mask` is non-zero.

-   [Java](#tab-panel-787)
-   [Python](#tab-panel-788)
-   [C](#tab-panel-789)
-   [Go](#tab-panel-790)
-   [C#](#tab-panel-791)
-   [Node.js](#tab-panel-792)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.intOr(

      Exp.intBin("read_mask"),

      Exp.intBin("write_mask")),

    Exp.val(0)));
```

```python
from aerospike_helpers.expressions import GT, IntBin, IntOr

exp = GT(IntOr(IntBin("read_mask"), IntBin("write_mask")), 0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_int_or(

      as_exp_bin_int("read_mask"),

      as_exp_bin_int("write_mask")),

    as_exp_int(0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpIntOr(as.ExpIntBin("read_mask"), as.ExpIntBin("write_mask")),

  as.ExpIntVal(0))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.IntOr(Exp.IntBin("read_mask"), Exp.IntBin("write_mask")),

    Exp.Val(0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(

  exp.intOr(exp.binInt('read_mask'), exp.binInt('write_mask')),

  exp.int(0))
```

---

#### `int_rscan`

```python
int_rscan(value, search)
```

Description: Create expression that scans integer bits from right (the least significant bit) to left (the most significant bit), looking for a search bit value. When the search value is found, the index of that bit (where the most significant bit is index 0) is returned. If “search” is true, the scan will search for the bit value 1. If “search” is false it will search for bit value 0.

Arguments: | Name | Type |
| --- | --- |
| `value` | `integer_expr` |
| `search` | `boolean_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where a right-scan for bit 1 in integer bin `visits` reports an index greater than 56 (recent activity in high bits of a 64-bit field).

-   [Java](#tab-panel-793)
-   [Python](#tab-panel-794)
-   [C](#tab-panel-795)
-   [Go](#tab-panel-796)
-   [C#](#tab-panel-797)
-   [Node.js](#tab-panel-798)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.rscan(Exp.intBin("visits"), Exp.val(true)),

    Exp.val(56)));
```

```python
from aerospike_helpers.expressions import GT, IntBin, IntRightScan

exp = GT(IntRightScan(IntBin("visits"), True), 56).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_int_rscan(

      as_exp_bin_int("visits"), as_exp_bool(true)),

    as_exp_int(56)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpIntRScan(as.ExpIntBin("visits"), as.ExpBoolVal(true)),

  as.ExpIntVal(56))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.Rscan(Exp.IntBin("visits"), Exp.Val(true)),

    Exp.Val(56)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(

  exp.intRscan(exp.binInt('visits'), exp.bool(true)),

  exp.int(56))
```

---

#### `int_rshift`

```python
int_rshift(value, by_numbits)
```

Description: Creates a logical right-shift operator (>>>) for use with integers.

Arguments: | Name | Type |
| --- | --- |
| `value` | `integer_expr` |
| `by_numbits` | `integer_value` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Determine whether the 6th bit from the left is set in integer bin `flags` (logical right shift then mask).

-   [Java](#tab-panel-799)
-   [Python](#tab-panel-800)
-   [C](#tab-panel-801)
-   [Go](#tab-panel-802)
-   [C#](#tab-panel-803)
-   [Node.js](#tab-panel-804)

```java
Expression exp = Exp.build(

  Exp.eq(

    Exp.intAnd(

      Exp.rshift(Exp.intBin("flags"), Exp.val(6)),

      Exp.val(1)),

    Exp.val(1)));
```

```python
from aerospike_helpers.expressions import Eq, IntAnd, IntBin, IntRightShift

exp = Eq(

    IntAnd(IntRightShift(IntBin("flags"), 6), 1),

    1,

).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_eq(

    as_exp_int_and(

      as_exp_int_rshift(as_exp_bin_int("flags"), as_exp_int(6)),

      as_exp_int(1)),

    as_exp_int(1)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpEq(

  as.ExpIntAnd(

    as.ExpIntRShift(as.ExpIntBin("flags"), as.ExpIntVal(6)),

    as.ExpIntVal(1)),

  as.ExpIntVal(1))
```

```csharp
Expression exp = Exp.Build(

  Exp.EQ(

    Exp.IntAnd(

      Exp.Rshift(Exp.IntBin("flags"), Exp.Val(6)),

      Exp.Val(1)),

    Exp.Val(1)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.eq(

  exp.intAnd(exp.intRshift(exp.binInt('flags'), exp.int(6)), exp.int(1)),

  exp.int(1))
```

---

#### `int_xor`

```python
int_xor(arg0, arg1, ...)
```

Description: Creates an “xor” operator (^) that is applied to two or more integers. All arguments must resolve to integers.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `integer_expr` |
| `arg1` | `integer_expr` |
| `...` | `integer_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where the bitwise XOR of integer bins `a` and `b` is non-zero.

-   [Java](#tab-panel-805)
-   [Python](#tab-panel-806)
-   [C](#tab-panel-807)
-   [Go](#tab-panel-808)
-   [C#](#tab-panel-809)
-   [Node.js](#tab-panel-810)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.intXor(

      Exp.intBin("a"),

      Exp.intBin("b")),

    Exp.val(0)));
```

```python
from aerospike_helpers.expressions import GT, IntBin, IntXOr

exp = GT(IntXOr(IntBin("a"), IntBin("b")), 0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_int_xor(

      as_exp_bin_int("a"),

      as_exp_bin_int("b")),

    as_exp_int(0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpIntXor(as.ExpIntBin("a"), as.ExpIntBin("b")),

  as.ExpIntVal(0))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.IntXor(Exp.IntBin("a"), Exp.IntBin("b")),

    Exp.Val(0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(exp.intXor(exp.binInt('a'), exp.binInt('b')), exp.int(0))
```

---

#### `log`

```python
log(num, base)
```

Description: Creates a “log” operator for the logarithm of the number “num” with base “base”. Arguments must all be ‘float\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `num` | `float_expr` |
| `base` | `float_expr` |

Returns: `float_value`

Introduced: 5.6.0

Example: Find records where the base-8 logarithm of float bin `branches` is greater than 2.

-   [Java](#tab-panel-811)
-   [Python](#tab-panel-812)
-   [C](#tab-panel-813)
-   [Go](#tab-panel-814)
-   [C#](#tab-panel-815)
-   [Node.js](#tab-panel-816)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.log(Exp.floatBin("branches"), Exp.val(8.0)),

    Exp.val(2.0)));
```

```python
from aerospike_helpers.expressions import FloatBin, GT, Log

exp = GT(Log(FloatBin("branches"), 8.0), 2.0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_log(as_exp_bin_float("branches"), as_exp_float(8.0)),

    as_exp_float(2.0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpNumLog(as.ExpFloatBin("branches"), as.ExpFloatVal(8.0)),

  as.ExpFloatVal(2.0))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.Log(Exp.FloatBin("branches"), Exp.Val(8.0)),

    Exp.Val(2.0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(

  exp.log(exp.binFloat('branches'), exp.float(8.0)),

  exp.float(2.0))
```

---

#### `max`

```python
max(arg0, arg1, ...)
```

Description: Creates an expression that returns the maximum value in a variable number of expressions. Arguments must all be either ‘float\_expr’ or ‘integer\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `number_expr` |
| `arg1` | `number_expr` |
| `...` | `number_expr` |

Returns: `number_value`

Introduced: 5.6.0

Example: Find records where the maximum of integer bins `value0`–`value3` is greater than 100.

-   [Java](#tab-panel-817)
-   [Python](#tab-panel-818)
-   [C](#tab-panel-819)
-   [Go](#tab-panel-820)
-   [C#](#tab-panel-821)
-   [Node.js](#tab-panel-822)

```java
Expression exp = Exp.build(

  Exp.gt(

    Exp.max(

      Exp.intBin("value0"),

      Exp.intBin("value1"),

      Exp.intBin("value2"),

      Exp.intBin("value3")),

    Exp.val(100)));
```

```python
from aerospike_helpers.expressions import GT, IntBin, Max

exp = GT(

    Max(

        IntBin("value0"),

        IntBin("value1"),

        IntBin("value2"),

        IntBin("value3"),

    ),

    100,

).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_gt(

    as_exp_max(

      as_exp_bin_int("value0"),

      as_exp_bin_int("value1"),

      as_exp_bin_int("value2"),

      as_exp_bin_int("value3")),

    as_exp_int(100)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreater(

  as.ExpMax(

    as.ExpIntBin("value0"),

    as.ExpIntBin("value1"),

    as.ExpIntBin("value2"),

    as.ExpIntBin("value3")),

  as.ExpIntVal(100))
```

```csharp
Expression exp = Exp.Build(

  Exp.GT(

    Exp.Max(

      Exp.IntBin("value0"),

      Exp.IntBin("value1"),

      Exp.IntBin("value2"),

      Exp.IntBin("value3")),

    Exp.Val(100)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.gt(

  exp.max(

    exp.binInt('value0'),

    exp.binInt('value1'),

    exp.binInt('value2'),

    exp.binInt('value3')),

  exp.int(100))
```

---

#### `min`

```python
min(arg0, arg1, ...)
```

Description: Creates an expression that returns the minimum value in a variable number of expressions. Arguments must all be either ‘float\_expr’ or ‘integer\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `number_expr` |
| `arg1` | `number_expr` |
| `...` | `number_expr` |

Returns: `number_value`

Introduced: 5.6.0

Example: Find records where the minimum of integer bins `value0`–`value3` is less than 10.

-   [Java](#tab-panel-823)
-   [Python](#tab-panel-824)
-   [C](#tab-panel-825)
-   [Go](#tab-panel-826)
-   [C#](#tab-panel-827)
-   [Node.js](#tab-panel-828)

```java
Expression exp = Exp.build(

  Exp.lt(

    Exp.min(

      Exp.intBin("value0"),

      Exp.intBin("value1"),

      Exp.intBin("value2"),

      Exp.intBin("value3")),

    Exp.val(10)));
```

```python
from aerospike_helpers.expressions import IntBin, LT, Min

exp = LT(

    Min(

        IntBin("value0"),

        IntBin("value1"),

        IntBin("value2"),

        IntBin("value3"),

    ),

    10,

).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_lt(

    as_exp_min(

      as_exp_bin_int("value0"),

      as_exp_bin_int("value1"),

      as_exp_bin_int("value2"),

      as_exp_bin_int("value3")),

    as_exp_int(10)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpLess(

  as.ExpMin(

    as.ExpIntBin("value0"),

    as.ExpIntBin("value1"),

    as.ExpIntBin("value2"),

    as.ExpIntBin("value3")),

  as.ExpIntVal(10))
```

```csharp
Expression exp = Exp.Build(

  Exp.LT(

    Exp.Min(

      Exp.IntBin("value0"),

      Exp.IntBin("value1"),

      Exp.IntBin("value2"),

      Exp.IntBin("value3")),

    Exp.Val(10)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.lt(

  exp.min(

    exp.binInt('value0'),

    exp.binInt('value1'),

    exp.binInt('value2'),

    exp.binInt('value3')),

  exp.int(10))
```

---

#### `mod`

```python
mod(numerator, denominator)
```

Description: Creates a modulo operator (%) that determines the remainder of “numerator” divided by “denominator”. Arguments must all be ‘integer\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `numerator` | `integer_expr` |
| `denominator` | `integer_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where integer bin `value` modulo 2 equals 0.

-   [Java](#tab-panel-829)
-   [Python](#tab-panel-830)
-   [C](#tab-panel-831)
-   [Go](#tab-panel-832)
-   [C#](#tab-panel-833)
-   [Node.js](#tab-panel-834)

```java
Expression exp = Exp.build(

  Exp.eq(

    Exp.mod(Exp.intBin("value"), Exp.val(2)),

    Exp.val(0)));
```

```python
from aerospike_helpers.expressions import Eq, IntBin, Mod

exp = Eq(Mod(IntBin("value"), 2), 0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_eq(

    as_exp_mod(as_exp_bin_int("value"), as_exp_int(2)),

    as_exp_int(0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpEq(

  as.ExpNumMod(as.ExpIntBin("value"), as.ExpIntVal(2)),

  as.ExpIntVal(0))
```

```csharp
Expression exp = Exp.Build(

  Exp.EQ(

    Exp.Mod(Exp.IntBin("value"), Exp.Val(2)),

    Exp.Val(0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.eq(

  exp.mod(exp.binInt('value'), exp.int(2)),

  exp.int(0))
```

---

#### `mul`

```python
mul(arg0, arg1, ...)
```

Description: Creates a multiplication operator (\*) that applies to a variable number of expression arguments. If only one argument is supplied, returns that argument. Arguments must all be either ‘float\_expr’ or ‘integer\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `number_expr` |
| `arg1` | `number_expr` |
| `...` | `number_expr` |

Returns: `number_value`

Introduced: 5.6.0

Example: Find records where the product of integer bins `height` and `width` is less than 100.

-   [Java](#tab-panel-835)
-   [Python](#tab-panel-836)
-   [C](#tab-panel-837)
-   [Go](#tab-panel-838)
-   [C#](#tab-panel-839)
-   [Node.js](#tab-panel-840)

```java
Expression exp = Exp.build(

  Exp.lt(

    Exp.mul(

      Exp.intBin("height"),

      Exp.intBin("width")),

    Exp.val(100)));
```

```python
from aerospike_helpers.expressions import IntBin, LT, Mul

exp = LT(Mul(IntBin("height"), IntBin("width")), 100).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_lt(

    as_exp_mul(

      as_exp_bin_int("height"),

      as_exp_bin_int("width")),

    as_exp_int(100)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpLess(

  as.ExpNumMul(as.ExpIntBin("height"), as.ExpIntBin("width")),

  as.ExpIntVal(100))
```

```csharp
Expression exp = Exp.Build(

  Exp.LT(

    Exp.Mul(Exp.IntBin("height"), Exp.IntBin("width")),

    Exp.Val(100)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.lt(

  exp.mul(exp.binInt('height'), exp.binInt('width')),

  exp.int(100))
```

---

#### `pow`

```python
pow(base, exponent)
```

Description: Creates a “pow” operator that raises the base “base” to the power of “exponent”. Arguments must all be ‘float\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `base` | `float_expr` |
| `exponent` | `float_expr` |

Returns: `float_value`

Introduced: 5.6.0

Example: Find records where float bin `p` raised to the power of integer bin `events` (converted to float) is less than 0.5.

-   [Java](#tab-panel-841)
-   [Python](#tab-panel-842)
-   [C](#tab-panel-843)
-   [Go](#tab-panel-844)
-   [C#](#tab-panel-845)
-   [Node.js](#tab-panel-846)

```java
Expression exp = Exp.build(

  Exp.lt(

    Exp.pow(

      Exp.floatBin("p"),

      Exp.toFloat(Exp.intBin("events"))),

    Exp.val(0.5)));
```

```python
from aerospike_helpers.expressions import FloatBin, IntBin, LT, Pow, ToFloat

exp = LT(Pow(FloatBin("p"), ToFloat(IntBin("events"))), 0.5).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_lt(

    as_exp_pow(as_exp_bin_float("p"),

      as_exp_to_float(as_exp_bin_int("events"))),

    as_exp_float(0.5)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpLess(

  as.ExpNumPow(as.ExpFloatBin("p"), as.ExpToFloat(as.ExpIntBin("events"))),

  as.ExpFloatVal(0.5))
```

```csharp
Expression exp = Exp.Build(

  Exp.LT(

    Exp.Pow(Exp.FloatBin("p"), Exp.ToFloat(Exp.IntBin("events"))),

    Exp.Val(0.5)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.lt(

  exp.pow(exp.binFloat('p'), exp.toFloat(exp.binInt('events'))),

  exp.float(0.5))
```

---

#### `sub`

```python
sub(arg0, arg1, ...)
```

Description: Creates a subtract operator (-) that applies to a variable number of expression arguments. Arguments must all be either ‘float\_expr’ or ‘integer\_expr’. Subtracts arguments from left to right:

-   sub(10,5) = (10-5) = 4
-   sub(10,5,1) = (10 - (5 + 1)) = 1 or, in alternate notation, ((10 - 5) - 1).
-   Negates single arguments: sub(-1) = 1 and sub(1) = -1.

Arguments: | Name | Type |
| --- | --- |
| `arg0` | `number_expr` |
| `arg1` | `number_expr` |
| `...` | `number_expr` |

Returns: `number_value`

Introduced: 5.6.0

Example: Find records where the difference between integer bin `assets` and `debts` is less than 1000000.

-   [Java](#tab-panel-847)
-   [Python](#tab-panel-848)
-   [C](#tab-panel-849)
-   [Go](#tab-panel-850)
-   [C#](#tab-panel-851)
-   [Node.js](#tab-panel-852)

```java
Expression exp = Exp.build(

  Exp.lt(

    Exp.sub(

      Exp.intBin("assets"),

      Exp.intBin("debts")),

    Exp.val(1000000)));
```

```python
from aerospike_helpers.expressions import IntBin, LT, Sub

exp = LT(Sub(IntBin("assets"), IntBin("debts")), 1000000).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_lt(

    as_exp_sub(

      as_exp_bin_int("assets"),

      as_exp_bin_int("debts")),

    as_exp_int(1000000)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpLess(

  as.ExpNumSub(as.ExpIntBin("assets"), as.ExpIntBin("debts")),

  as.ExpIntVal(1000000))
```

```csharp
Expression exp = Exp.Build(

  Exp.LT(

    Exp.Sub(Exp.IntBin("assets"), Exp.IntBin("debts")),

    Exp.Val(1000000)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.lt(

  exp.sub(exp.binInt('assets'), exp.binInt('debts')),

  exp.int(1000000))
```

---

#### `to_float`

```python
to_float(value)
```

Description: Creates an expression that converts an integer value to a floating-point value. The argument must be a ‘float\_expr’.

Arguments: | Name | Type |
| --- | --- |
| `value` | `integer_expr` |

Returns: `float_value`

Introduced: 5.6.0

Example: Find records where `to_float` of integer bin `quantity` is at least 1.0 (for float comparisons without changing stored bin types).

-   [Java](#tab-panel-853)
-   [Python](#tab-panel-854)
-   [C](#tab-panel-855)
-   [Go](#tab-panel-856)
-   [C#](#tab-panel-857)
-   [Node.js](#tab-panel-858)

```java
Expression exp = Exp.build(

  Exp.ge(

    Exp.toFloat(Exp.intBin("quantity")),

    Exp.val(1.0)));
```

```python
from aerospike_helpers.expressions import GE, IntBin, ToFloat

exp = GE(ToFloat(IntBin("quantity")), 1.0).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_ge(

    as_exp_to_float(as_exp_bin_int("quantity")),

    as_exp_float(1.0)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpGreaterEq(

  as.ExpToFloat(as.ExpIntBin("quantity")),

  as.ExpFloatVal(1.0))
```

```csharp
Expression exp = Exp.Build(

  Exp.GE(

    Exp.ToFloat(Exp.IntBin("quantity")),

    Exp.Val(1.0)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.ge(exp.toFloat(exp.binInt('quantity')), exp.float(1.0))
```

---

#### `to_int`

```python
to_int(value)
```

Description: Creates an expression that converts a floating-point value to an integer value. The argument must be a `float_expr`.

Arguments: | Name | Type |
| --- | --- |
| `value` | `float_expr` |

Returns: `integer_value`

Introduced: 5.6.0

Example: Find records where `to_int` of float bin `list_price` equals 12 (aligned with whole-dollar list prices in path docs).

-   [Java](#tab-panel-859)
-   [Python](#tab-panel-860)
-   [C](#tab-panel-861)
-   [Go](#tab-panel-862)
-   [C#](#tab-panel-863)
-   [Node.js](#tab-panel-864)

```java
Expression exp = Exp.build(

  Exp.eq(

    Exp.toInt(Exp.floatBin("list_price")),

    Exp.val(12)));
```

```python
from aerospike_helpers.expressions import Eq, FloatBin, ToInt

exp = Eq(ToInt(FloatBin("list_price")), 12).compile()
```

```c
as_exp_build(predexp,

  as_exp_cmp_eq(

    as_exp_to_int(as_exp_bin_float("list_price")),

    as_exp_int(12)));
```

```go
// Import path matches the Go client examples elsewhere on this doc site (/v6).

// If you use the latest client line, switch to .../aerospike-client-go/v8 (API names unchanged).

// Requires: import as "github.com/aerospike/aerospike-client-go/v6"

exp := as.ExpEq(

  as.ExpToInt(as.ExpFloatBin("list_price")),

  as.ExpIntVal(12))
```

```csharp
Expression exp = Exp.Build(

  Exp.EQ(

    Exp.ToInt(Exp.FloatBin("list_price")),

    Exp.Val(12)));
```

```javascript
const exp = Aerospike.exp

const filterExp = exp.eq(exp.toInt(exp.binFloat('list_price')), exp.int(12))
```

---