Integer twos complement convert

integer-twos-complement-convert · version 1.0.0 · Numbers & math · free, no key needed

Reinterpret one fixed-width two's-complement pattern as signed and unsigned; returns both decimals, hex and binary.

Use when you need to: 32 bit unsigned to signed two's complement integer · signed integer to unsigned same bits · reinterpret hexadecimal as signed integer.

Decide before calling

Read the versioned contract and the supported scope below. Reuse integer-twos-complement-convert@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use integer-twos-complement-convert@1.0.0 for 32 bit unsigned to signed two's complement integer. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "value": "0xffffffff",
  "width": 32,
  "interpret_as": "unsigned"
}

Response:

{
  "result": {
    "standard_version": "ISO/IEC 14882:2020 [basic.fundamental]; ISO/IEC 9899:2018 fixed-width unsigned representation",
    "width": 32,
    "hex": "0xffffffff",
    "binary": "0b11111111111111111111111111111111",
    "signed_decimal": "-1",
    "unsigned_decimal": "4294967295"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "integer-twos-complement-convert",
  "version": "1.0.0",
  "input": {
    "value": "0xffffffff",
    "width": 32,
    "interpret_as": "unsigned"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/integer-twos-complement-convert/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":"0xffffffff","width":32,"interpret_as":"unsigned"}'

The machine-readable contract is at /v1/tools/integer-twos-complement-convert/versions/1.0.0.

CLI

node cli.mjs run integer-twos-complement-convert 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.