RRadix Foundry
Product

Product features · Integer radix formatting

01

Check zero, a negative value and both base limits, rejecting booleans, fractional values and unsupported bases.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Integer radix formatting

● ● ●Radix Foundry●
A concrete starting point · Integer radix formatting ×
def format_radix(value, base):
    if type(value) is not int or type(base) is not int or not 2 <= base <= 36:
        raise ValueError("radix.input")
    if value == 0:
        return "0"
    sign, value = ("-" if value < 0 else ""), abs(value)
    digits = "0123456789abcdefghijklmnopqrstuvwxyz"
    result = ""
    while value:
        value, remainder = divmod(value, base)
        result = digits[remainder] + result
    return sign + result
✳Integer radix formatting
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗