Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BLI_math_base_safe.h « blenlib « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bfef65d06c53db88f38f7079668e9178c4d02915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* SPDX-License-Identifier: GPL-2.0-or-later */

#pragma once

/** \file
 * \ingroup bli
 *
 * This file provides safe alternatives to common math functions like sqrt, powf.
 * In this context "safe" means that the output is not NaN if the input is not NaN.
 */

#include "BLI_math_base.h"

#ifdef __cplusplus
extern "C" {
#endif

MINLINE float safe_divide(float a, float b);
MINLINE float safe_modf(float a, float b);
MINLINE float safe_logf(float a, float base);
MINLINE float safe_sqrtf(float a);
MINLINE float safe_inverse_sqrtf(float a);
MINLINE float safe_asinf(float a);
MINLINE float safe_acosf(float a);
MINLINE float safe_powf(float base, float exponent);

#ifdef __cplusplus
}
#endif

#if BLI_MATH_DO_INLINE
#  include "intern/math_base_safe_inline.c"
#endif