qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. fraction  (  r  )[source]

The numerator and denominator of a fraction.

Parameters:
rRational | str

A sympy.Rational or a str with the format "num/denom".

Returns:
(num, denom)tuple[int, int]

The numerator and denominator of r.

Raises:
TypeError

If r is neither a sympy.Rational nor a str.