Commit graph

8 commits

Author SHA1 Message Date
Ben Wiederhake f07847e099 Everywhere: Remove unused includes of AK/Concepts.h
These instances were detected by searching for files that include
AK/Concepts.h, but don't match the regex:

\\b(AnyString|Arithmetic|ArrayLike|DerivedFrom|Enum|FallibleFunction|Flo
atingPoint|Fundamental|HashCompatible|Indexable|Integral|IterableContain
er|IteratorFunction|IteratorPairWith|OneOf|OneOfIgnoringCV|SameAs|Signed
|SpecializationOf|Unsigned|VoidFunction)\\b

(Without the linebreaks.)

This regex is pessimistic, so there might be more files that don't
actually use any concepts.

In theory, one might use LibCPP to detect things like this
automatically, but let's do this one step after another.
2023-01-02 20:27:20 -05:00
Linus Groh d26aabff04 Everywhere: Run clang-format 2022-12-03 23:52:23 +00:00
Steffen Rusitschka 1aa07d7328 AK: Implement FloatExtractor<f128>
This patch adds support for 128-bit floating points in FloatExtractor.

This is required to build SerenityOS on MacOS/aarch64. It might break
building for Raspberry Pi.
2022-12-02 16:22:51 +01:00
Andreas Kling ae3ffdd521 AK: Make it possible to not using AK classes into the global namespace
This patch adds the `USING_AK_GLOBALLY` macro which is enabled by
default, but can be overridden by build flags.

This is a step towards integrating Jakt and AK types.
2022-11-26 15:51:34 +01:00
Dan Klishch 73f4cfa930 AK: Introduce fixed-width floating point types (f32, f64, f80 and f128) 2022-11-05 16:04:12 -06:00
Dan Klishch 59e87cc998 AK: Add static_assert to check for effective size of long double 2022-11-03 20:17:09 -06:00
Dan Klishch 17c9a3e8d9 AK+LibC+LibCrypto: Move FloatExtractor to AK/FloatingPoint.h 2022-11-03 20:17:09 -06:00
Jelle Raaijmakers 8483064b59 AK: Add FloatingPoint.h
This is a set of functions that allow you to convert between arbitrary
IEEE 754 floating point types, as long as they can be represented
within 64 bits. Conversion methods between floats and doubles are
provided, as well as a generic `float_to_float()`.

Example usage:

  #include <AK/FloatingPoint.h>

  double val = 1.234;
  auto weird_f16 =
      convert_from_native_double<FloatingPointBits<0, 6, 10>>(val);

Signed and unsigned floats are supported, and both NaN and +/-Inf are
handled correctly. Values that do not fit in the target floating point
type are clamped.
2022-08-27 12:28:05 +02:00