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. half_integer_to_fraction  (  val  )[source]

The numerator and denominator of a half-integer.

Parameters:
valscalar

A half-integer value.

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

The numerator and denominator of the half-integer.

Raises:
ValueError

If val is not a multiple of 1/2.