ReactOS 0.4.16-dev-1946-g52006dd
log10.c File Reference
#include "math_helpers.h"
Include dependency graph for log10.c:

Go to the source code of this file.

Macros

#define _CRTBLD
 
#define HAS_LOG10F
 

Functions

void Test_log10_exact (void)
 
void Test_log10_approx (void)
 
void Test_log10f_exact (void)
 
void Test_log10f_approx (void)
 
 START_TEST (log10)
 

Variables

static TESTENTRY_DBL s_log10_exact_tests []
 
static TESTENTRY_DBL_APPROX s_log10_approx_tests []
 
static TESTENTRY_DBL s_log10f_exact_tests []
 
static TESTENTRY_DBL_APPROX s_log10f_approx_tests []
 

Macro Definition Documentation

◆ _CRTBLD

#define _CRTBLD

Definition at line 9 of file log10.c.

◆ HAS_LOG10F

#define HAS_LOG10F

Definition at line 18 of file log10.c.

Function Documentation

◆ START_TEST()

START_TEST ( log10  )

Definition at line 257 of file log10.c.

258{
261#if defined(HAS_LOG10F)
264#endif
265#if defined(HAS_LIBM_SSE2)
266 Test_libm_sse2_log10();
267 Test_libm_sse2_log10f();
268#endif
269}
void Test_log10_approx(void)
Definition: log10.c:99
void Test_log10f_approx(void)
Definition: log10.c:197
void Test_log10_exact(void)
Definition: log10.c:43
void Test_log10f_exact(void)
Definition: log10.c:134

◆ Test_log10_approx()

void Test_log10_approx ( void  )

Definition at line 99 of file log10.c.

100{
101 for (int i = 0; i < _countof(s_log10_approx_tests); i++)
102 {
103 double x = s_log10_approx_tests[i].x;
105 double z = log10(x);
107 ok(error <= s_log10_approx_tests[i].max_error,
108 "log10(%.17e) = %.17e, expected %.17e, error %I64d ULPs, max %u ULPs\n",
109 x, z, expected, error, s_log10_approx_tests[i].max_error);
110 }
111}
#define ok(value,...)
Definition: atltest.h:57
INT64 int64_t
Definition: types.h:72
#define abs(i)
Definition: fconv.c:206
double log10(double x)
Definition: freeldr.c:190
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble GLdouble z
Definition: glext.h:5874
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static TESTENTRY_DBL_APPROX s_log10_approx_tests[]
Definition: log10.c:54
static __inline int64_t ulp_error_precise(PRECISE_VALUE *expected, double result)
Definition: math_helpers.h:154
#define error(str)
Definition: mkdosfs.c:1605
BOOL expected
Definition: store.c:2000
#define _countof(array)
Definition: sndvol32.h:70
PRECISE_VALUE expected
Definition: math_helpers.h:87

Referenced by START_TEST().

◆ Test_log10_exact()

void Test_log10_exact ( void  )

Definition at line 43 of file log10.c.

44{
45 for (int i = 0; i < _countof(s_log10_exact_tests); i++)
46 {
48 double z = log10(x);
50 }
51}
GLuint64EXT * result
Definition: glext.h:11304
static TESTENTRY_DBL s_log10_exact_tests[]
Definition: log10.c:25
#define ok_eq_dbl_exact(func, ullx, z, ullexp)
Definition: math_helpers.h:184
static __inline double u64_to_dbl(UINT64 x)
Definition: math_helpers.h:25

Referenced by START_TEST().

◆ Test_log10f_approx()

void Test_log10f_approx ( void  )

Definition at line 197 of file log10.c.

198{
199 for (int i = 0; i < _countof(s_log10f_approx_tests); i++)
200 {
201 float x = s_log10f_approx_tests[i].x;
203 float z = log10f(x);
205 ok(error <= s_log10_approx_tests[i].max_error,
206 "log10(%.6e) = %.7e, expected %.7e, error %I64d ULPs, max %u ULPs\n",
207 x, z, expected, error, s_log10_approx_tests[i].max_error);
208 }
209}
_Check_return_ float __cdecl log10f(_In_ float x)
Definition: math.h:244
static TESTENTRY_DBL_APPROX s_log10f_approx_tests[]
Definition: log10.c:148
static __inline int ulp_error_flt(float expected, float result)
Definition: math_helpers.h:138

Referenced by START_TEST().

◆ Test_log10f_exact()

void Test_log10f_exact ( void  )

Definition at line 134 of file log10.c.

135{
136 for (int i = 0; i < _countof(s_log10f_exact_tests); i++)
137 {
139 float z = log10f(x);
141 }
142}
static TESTENTRY_DBL s_log10f_exact_tests[]
Definition: log10.c:116
#define ok_eq_flt_exact(func, ux, z, uexp)
Definition: math_helpers.h:194

Referenced by START_TEST().

Variable Documentation

◆ s_log10_approx_tests

TESTENTRY_DBL_APPROX s_log10_approx_tests[]
static

Definition at line 54 of file log10.c.

Referenced by Test_log10_approx(), and Test_log10f_approx().

◆ s_log10_exact_tests

TESTENTRY_DBL s_log10_exact_tests[]
static
Initial value:
=
{
{ 0x0000000000000000 , 0xfff0000000000000 },
{ 0x8000000000000000 , 0xfff0000000000000 },
{ 0x7ff0000000000000 , 0x7ff0000000000000 },
{ 0x7ff0000000000001 , 0x7ff8000000000001 },
{ 0x7ff7ffffffffffff , 0x7fffffffffffffff },
{ 0x7ff8000000000000 , 0x7ff8000000000000 },
{ 0x7ff8000000000001 , 0x7ff8000000000001 },
{ 0x7fffffffffffffff , 0x7fffffffffffffff },
{ 0xfff0000000000000 , 0xfff8000000000000 },
{ 0xfff0000000000001 , 0xfff8000000000001 },
{ 0xfff7ffffffffffff , 0xffffffffffffffff },
{ 0xfff8000000000000 , 0xfff8000000000000 },
{ 0xfff8000000000001 , 0xfff8000000000001 },
{ 0xffffffffffffffff , 0xffffffffffffffff },
}

Definition at line 25 of file log10.c.

Referenced by Test_log10_exact().

◆ s_log10f_approx_tests

TESTENTRY_DBL_APPROX s_log10f_approx_tests[]
static

Definition at line 148 of file log10.c.

Referenced by Test_log10f_approx().

◆ s_log10f_exact_tests

TESTENTRY_DBL s_log10f_exact_tests[]
static
Initial value:
=
{
{ 0x00000000 , 0xff800000 },
{ 0x80000000 , 0xff800000 },
{ 0x7f800000 , 0xff800000 },
{ 0x7f800001 , 0xff800000 },
{ 0x7fBFffff , 0xff800000 },
{ 0x7fC00000 , 0xff800000 },
{ 0x7fC80001 , 0xff800000 },
{ 0x7fFfffff , 0xff800000 },
{ 0xff800000 , 0xff800000 },
{ 0xff800001 , 0xff800000 },
{ 0xffBfffff , 0xff800000 },
{ 0xffC00000 , 0xff800000 },
{ 0xfff80001 , 0xff800000 },
{ 0xffffffff , 0xff800000 },
}

Definition at line 116 of file log10.c.

Referenced by Test_log10f_exact().