BinaryFormat.SignedInteger32

Binary

A binary format that reads a 32-bit signed integer.

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

BinaryFormat.SignedInteger32(binary as binary) as any

Parameters

NameTypeRequiredDescription
binarybinaryYesThe binary data to read the 32-bit signed integer from.

Return Value

functionA binary format function that reads a 4-byte signed integer from binary data.

Remarks

BinaryFormat.SignedInteger32 is a binary format specifier that reads a 32-bit (4-byte) signed integer from binary data. The value range is -2,147,483,648 to 2,147,483,647 (Int32 / int). The integer is stored in two's complement format.

The default byte order is little-endian. Use BinaryFormat.ByteOrder to wrap this format if the source data uses big-endian byte ordering.

This is the most commonly used signed integer format in binary files, corresponding to a standard 32-bit integer in most programming languages.

Examples

Example 1: Read a 32-bit signed integer

let
    binaryData = #binary({0x01, 0x00, 0x00, 0x00}),
    result = BinaryFormat.SignedInteger32(binaryData)
in
    result

Example 2: Read a negative 32-bit signed integer

let
    // -100 in 32-bit two's complement little-endian
    binaryData = #binary({0x9C, 0xFF, 0xFF, 0xFF}),
    result = BinaryFormat.SignedInteger32(binaryData)
in
    result

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks