RRatioFlint
Product

Product features · Canonical rational fractions

01

Reduce a fraction of two integers to a positive denominator and coprime terms.

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.

Canonical rational fractions

● ● ●RatioFlint●
A concrete starting point · Canonical rational fractions ×
from math import gcd

def reduce_fraction(numerator, denominator):
    if any(type(v) is not int for v in (numerator, denominator)):
        raise ValueError("integer.required")
    if denominator == 0:
        raise ValueError("denominator.zero")
    if denominator < 0:
        numerator, denominator = -numerator, -denominator
    divisor = gcd(numerator, denominator)
    return numerator // divisor, denominator // divisor
✳Reduce a fraction of two integers to a positive denominator and coprime terms.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗