ReactOS 0.4.15-dev-8349-g6f277e9
log_special.c File Reference
#include <fpieee.h>
#include <excpt.h>
#include <float.h>
#include <math.h>
#include <errno.h>
#include "libm_new.h"
Include dependency graph for log_special.c:

Go to the source code of this file.

Macros

#define LOG_X_ZERO   1
 
#define LOG_X_NEG   2
 
#define LOG_X_NAN   3
 

Functions

static float _logf_special_common (float x, float y, U32 code, unsigned int op, char *name)
 
float _logf_special (float x, float y, U32 code)
 
float _log10f_special (float x, float y, U32 code)
 
static double _log_special_common (double x, double y, U32 code, unsigned int op, char *name)
 
double _log_special (double x, double y, U32 code)
 
double _log10_special (double x, double y, U32 code)
 

Macro Definition Documentation

◆ LOG_X_NAN

#define LOG_X_NAN   3

Definition at line 43 of file log_special.c.

◆ LOG_X_NEG

#define LOG_X_NEG   2

Definition at line 42 of file log_special.c.

◆ LOG_X_ZERO

#define LOG_X_ZERO   1

Definition at line 41 of file log_special.c.

Function Documentation

◆ _log10_special()

double _log10_special ( double  x,
double  y,
U32  code 
)

Definition at line 130 of file log_special.c.

131{
132 return _log_special_common(x, y, code, _FpCodeLog10, "log10");
133}
@ _FpCodeLog10
Definition: fpieee.h:56
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static double _log_special_common(double x, double y, U32 code, unsigned int op, char *name)
Definition: log_special.c:96
Definition: inflate.c:139

◆ _log10f_special()

float _log10f_special ( float  x,
float  y,
U32  code 
)

Definition at line 91 of file log_special.c.

92{
93 return _logf_special_common(x, y, code, _FpCodeLog10, "log10f");
94}
static float _logf_special_common(float x, float y, U32 code, unsigned int op, char *name)
Definition: log_special.c:45

◆ _log_special()

double _log_special ( double  x,
double  y,
U32  code 
)

Definition at line 125 of file log_special.c.

126{
127 return _log_special_common(x, y, code, _FpCodeLog, "log");
128}
@ _FpCodeLog
Definition: fpieee.h:55

◆ _log_special_common()

static double _log_special_common ( double  x,
double  y,
U32  code,
unsigned int  op,
char name 
)
static

Definition at line 96 of file log_special.c.

97{
98 switch(code)
99 {
100 case LOG_X_ZERO:
101 {
102 UT64 ym; ym.f64 = y;
104 }
105 break;
106
107 case LOG_X_NEG:
108 {
109 UT64 ym; ym.f64 = y;
111 }
112 break;
113
114 case LOG_X_NAN:
115 {
116 UT64 ym; ym.f64 = y;
117 _handle_error(name, op, ym.u64, _DOMAIN, 0, EDOM, x, 0.0, 1);
118 }
119 break;
120 }
121
122 return y;
123}
double __cdecl _handle_error(char *fname, int opcode, unsigned long long value, int type, int flags, int error, double arg1, double arg2, int nargs)
Handles an error condition.
Definition: _handle_error.c:34
#define ERANGE
Definition: acclib.h:92
UINT op
Definition: effect.c:236
#define EDOM
Definition: errno.h:39
#define _DOMAIN
Definition: math.h:39
#define _SING
Definition: math.h:40
#define AMD_F_DIVBYZERO
Definition: libm_new.h:85
#define AMD_F_INVALID
Definition: libm_new.h:86
#define LOG_X_NEG
Definition: log_special.c:42
#define LOG_X_NAN
Definition: log_special.c:43
#define LOG_X_ZERO
Definition: log_special.c:41
Definition: name.c:39
Definition: libm_new.h:47
F64 f64
Definition: libm_new.h:48
U64 u64
Definition: libm_new.h:49

Referenced by _log10_special(), and _log_special().

◆ _logf_special()

float _logf_special ( float  x,
float  y,
U32  code 
)

Definition at line 86 of file log_special.c.

87{
88 return _logf_special_common(x, y, code, _FpCodeLog, "logf");
89}

◆ _logf_special_common()

static float _logf_special_common ( float  x,
float  y,
U32  code,
unsigned int  op,
char name 
)
static

Definition at line 45 of file log_special.c.

46{
47 switch(code)
48 {
49 case LOG_X_ZERO:
50 {
51 UT64 ym; ym.u64 = 0; ym.f32[0] = y;
53 }
54 break;
55
56 case LOG_X_NEG:
57 {
58 UT64 ym; ym.u64 = 0; ym.f32[0] = y;
60 }
61 break;
62
63 case LOG_X_NAN:
64 {
65 unsigned int is_snan;
66 UT32 xm; UT64 ym;
67 xm.f32 = x;
68 is_snan = (((xm.u32 & QNAN_MASK_32) == QNAN_SET_32) ? 0 : 1);
69 ym.u64 = 0; ym.f32[0] = y;
70
71 if(is_snan)
72 {
74 }
75 else
76 {
77 _handle_errorf(name, op, ym.u64, _DOMAIN, 0, EDOM, x, 0.0, 1);
78 }
79 }
80 break;
81 }
82
83 return y;
84}
float __cdecl _handle_errorf(char *fname, int opcode, unsigned long long value, int type, int flags, int error, float arg1, float arg2, int nargs)
Definition: _handle_error.c:56
#define QNAN_MASK_32
Definition: libm_new.h:61
#define QNAN_SET_32
Definition: libm_new.h:71
Definition: libm_new.h:41
F32 f32
Definition: libm_new.h:42
U32 u32
Definition: libm_new.h:43
F32 f32[2]
Definition: libm_new.h:51

Referenced by _log10f_special(), and _logf_special().