Integer bits inspect

integer-bits-inspect · version 1.0.0 · Numbers & math · free, no key needed

Inspect or edit fixed-width integer bits and fields; returns set positions, popcount and decimal, hex and binary.

Use when you need to: integer bitfield decode flags bit positions hexadecimal · list which bits are set in integer · popcount integer flags.

Decide before calling

Read the versioned contract and the supported scope below. Reuse integer-bits-inspect@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-bits-inspect@1.0.0 for integer bitfield decode flags bit positions hexadecimal. 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:

{
  "operation": "inspect",
  "value": "0xa5",
  "width": 8,
  "signed": false
}

Response:

{
  "result": {
    "standard_version": "ISO/IEC 9899:2018 6.5.7, 6.5.10-6.5.12; ISO/IEC 14882:2020 [basic.fundamental]",
    "width": 8,
    "signed": false,
    "decimal": "165",
    "hex": "0xa5",
    "binary": "0b10100101",
    "set_bits": [
      0,
      2,
      5,
      7
    ],
    "popcount": 4
  }
}

How to call it

MCP

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

{
  "id": "integer-bits-inspect",
  "version": "1.0.0",
  "input": {
    "operation": "inspect",
    "value": "0xa5",
    "width": 8,
    "signed": false
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/integer-bits-inspect/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"operation":"inspect","value":"0xa5","width":8,"signed":false}'

The machine-readable contract is at /v1/tools/integer-bits-inspect/versions/1.0.0.

CLI

node cli.mjs run integer-bits-inspect 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.