From c25bd5bc78f841f04adf6de6384653331e5f6ced Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Wed, 9 Aug 2023 13:11:09 +0200 Subject: [PATCH] bw_math wip + settling on c++11 + some tests --- examples/common/android/android.mk | 2 +- examples/common/vst3/vst3.mk | 2 +- include/bw_math.h | 171 +++++---- test/Makefile | 16 + test/bw_math.c | 536 +++++++++++++++++++++++++++++ 5 files changed, 655 insertions(+), 72 deletions(-) create mode 100644 test/Makefile create mode 100644 test/bw_math.c diff --git a/examples/common/android/android.mk b/examples/common/android/android.mk index 1b5077e..465dcde 100644 --- a/examples/common/android/android.mk +++ b/examples/common/android/android.mk @@ -39,7 +39,7 @@ CXXFLAGS := \ -Wall \ -Wextra \ -Wpedantic \ - -std=c++20 + -std=c++11 LDFLAGS := \ -shared \ -static-libstdc++ \ diff --git a/examples/common/vst3/vst3.mk b/examples/common/vst3/vst3.mk index c1d79a3..567947c 100644 --- a/examples/common/vst3/vst3.mk +++ b/examples/common/vst3/vst3.mk @@ -17,7 +17,7 @@ CXXFLAGS := \ -Wall \ -Wextra \ -Wpedantic \ - -std=c++20 + -std=c++11 LDFLAGS := \ -shared diff --git a/include/bw_math.h b/include/bw_math.h index 83a1883..f89401b 100644 --- a/include/bw_math.h +++ b/include/bw_math.h @@ -20,17 +20,20 @@ /*! * module_type {{{ utility }}} - * version {{{ 0.6.0 }}} + * version {{{ 1.0.0 }}} * requires {{{ bw_common }}} * description {{{ * A collection of mathematical routines that strive to be better suited to * DSP than, e.g., those supplied by your C standard library. * * Such a goal is hopefully accomplished by: + * * * being as branchless as reasonable/convenient; - * * not handling uninteresting corner cases, such as invalid, - * infinity, and NaN input values; - * * returning approximated results (indicated in this documentation). + * * not handling uninteresting corner cases, such as out-of-range, + * NaN, and sometimes infinity input values (out-of-range and NaN inputs + * are always considered invalid and lead to undefined behavior); + * * returning approximated results (indicated in this documentation); + * * making no distinction between `0.f` and `-0.f`. * * In practice they should guarantee fast and consistent performance, but * always do your own benchmarking. @@ -41,6 +44,12 @@ * }}} * changelog {{{ *