LUMIERA.clone/src/lib/integral.hpp
Ichthyostega 77257c5653 Parameters: numeric-types deep dive
Turns out that implementing a cyclically wrapping domain properly is much more tricky than initially anticipated.

After initial analysis I decided where to draw the line and what ''esoteric features'' aspects to leave out.
Then I used Knowledge-Technology (Claude) to scrutinise and improve my implementation,
and to learn a lot more about integral arithmetics in general.
2026-09-14 01:50:26 +02:00

41 lines
969 B
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
INTEGRAL.hpp - there is nothing like one
Copyright (C)
2024, Hermann Vosseler <Ichthyostega@web.de>
  **Lumiera** is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by the
  Free Software Foundation; either version 2 of the License, or (at your
  option) any later version. See the file COPYING for further details.
*/
/** @file integral.hpp
** Inclusion for common place integral types and constants.
*/
#ifndef LIB_INTEGRAL_H
#define LIB_INTEGRAL_H
#include <cstddef>
#include <cstdint>
/* === minimal common place === */
using uint = unsigned int;
using uchar = unsigned char;
using ulong = unsigned long int;
using llong = long long int;
using ullong = unsigned long long int;
using ushort = unsigned short int;
using f128 = long double;
static_assert(10 <= sizeof(f128));
const uint LIFE_AND_UNIVERSE_4EVER = 42;
#endif /*LIB_INTEGRAL_H*/