from typing import Sequence
import ctypes


def build_c_double_array(values: Sequence[float]) -> ctypes.Array:
    """Convert a list of numbers to a ctypes c_double array.

    :param values: A list of floats.
    :return: The values as ctypes compatible values.

    """
    arr = (ctypes.c_double * len(values))(*values)

    return arr