#!/usr/bin/env python3
"""
@file generate__profiling_data.py
@brief Generate random numeric input data for profiling the stddev program.
@details
Prints the requested number of random floating-point values to standard output.
@author Jan Kostečka
@date 2026-04-18
"""

import random
import sys


def main() -> int:
    """@brief Generate random floating point input values.

    Reads the requested number of values from command-line arguments and
    prints that many random float numbers to standard output.

    @return Exit code 0 on success, non zero on invalid arguments.
    """
    if len(sys.argv) != 2:
        print("Usage: python3 src/generate_data.py <count>", file=sys.stderr)
        return 1

    try:
        count = int(sys.argv[1])
    except ValueError:
        print("Count must be an integer.", file=sys.stderr)
        return 1

    if count < 0:
        print("Count must be non-negative.", file=sys.stderr)
        return 1

    for _ in range(count):
        print(random.uniform(-1000.0, 1000.0))

    return 0


if __name__ == "__main__":
    raise SystemExit(main())