﻿---
title: ES|QL SCALB function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/2989/reference/query-languages/esql/functions-operators/math-functions/scalb
products:
  - Elasticsearch
---

# ES|QL SCALB function
<applies-to>
  - Elastic Stack: Generally available since 9.1
</applies-to>


## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/2989/reference/query-languages/esql/images/functions/scalb.svg)


## Parameters

<definitions>
  <definition term="d">
    Numeric expression for the multiplier. If `null`, the function returns `null`.
  </definition>
  <definition term="scaleFactor">
    Numeric expression for the scale factor. If `null`, the function returns `null`.
  </definition>
</definitions>


## Description

Returns the result of `d * 2 ^ scaleFactor`, Similar to Java's `scalb` function. Result is rounded as if performed by a single correctly rounded floating-point multiply to a member of the double value set.

## Supported types


| d             | scaleFactor | result |
|---------------|-------------|--------|
| double        | integer     | double |
| double        | long        | double |
| integer       | integer     | double |
| integer       | long        | double |
| long          | integer     | double |
| long          | long        | double |
| unsigned_long | integer     | double |
| unsigned_long | long        | double |


## Example

```esql
row x = 3.0, y = 10 | eval z = scalb(x, y)
```


| x:double | y:integer | z:double |
|----------|-----------|----------|
| 3.0      | 10        | 3072.0   |