ReactOS 0.4.15-dev-8349-g6f277e9
pow_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 pow_special.c:

Go to the source code of this file.

Macros

#define POW_X_ONE_Y_SNAN   1
 
#define POW_X_ZERO_Z_INF   2
 
#define POW_X_NAN   3
 
#define POW_Y_NAN   4
 
#define POW_X_NAN_Y_NAN   5
 
#define POW_X_NEG_Y_NOTINT   6
 
#define POW_Z_ZERO   7
 
#define POW_Z_DENORMAL   8
 
#define POW_Z_INF   9
 

Functions

float _powf_special (float x, float y, float z, U32 code)
 
double _pow_special (double x, double y, double z, U32 code)
 

Macro Definition Documentation

◆ POW_X_NAN

#define POW_X_NAN   3

Definition at line 38 of file pow_special.c.

◆ POW_X_NAN_Y_NAN

#define POW_X_NAN_Y_NAN   5

Definition at line 40 of file pow_special.c.

◆ POW_X_NEG_Y_NOTINT

#define POW_X_NEG_Y_NOTINT   6

Definition at line 41 of file pow_special.c.

◆ POW_X_ONE_Y_SNAN

#define POW_X_ONE_Y_SNAN   1

Definition at line 36 of file pow_special.c.

◆ POW_X_ZERO_Z_INF

#define POW_X_ZERO_Z_INF   2

Definition at line 37 of file pow_special.c.

◆ POW_Y_NAN

#define POW_Y_NAN   4

Definition at line 39 of file pow_special.c.

◆ POW_Z_DENORMAL

#define POW_Z_DENORMAL   8

Definition at line 43 of file pow_special.c.

◆ POW_Z_INF

#define POW_Z_INF   9

Definition at line 44 of file pow_special.c.

◆ POW_Z_ZERO

#define POW_Z_ZERO   7

Definition at line 42 of file pow_special.c.

Function Documentation

◆ _pow_special()

double _pow_special ( double  x,
double  y,
double  z,
U32  code 
)

Definition at line 92 of file pow_special.c.

93{
94 switch(code)
95 {
97 {
98 UT64 zm; zm.f64 = z;
100 }
101 break;
102
103 case POW_X_NAN:
104 case POW_Y_NAN:
105 case POW_X_NAN_Y_NAN:
107 {
108 UT64 zm; zm.f64 = z;
110 }
111 break;
112
113 case POW_Z_ZERO:
114 case POW_Z_DENORMAL:
115 {
116 UT64 zm; zm.f64 = z;
118 }
119 break;
120
121 case POW_Z_INF:
122 {
123 UT64 zm; zm.f64 = z;
125 }
126 break;
127 }
128
129 return z;
130}
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
#define EDOM
Definition: errno.h:39
@ _FpCodePow
Definition: fpieee.h:58
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble z
Definition: glext.h:5874
#define _DOMAIN
Definition: math.h:39
#define _SING
Definition: math.h:40
#define _UNDERFLOW
Definition: math.h:42
#define _OVERFLOW
Definition: math.h:41
#define AMD_F_DIVBYZERO
Definition: libm_new.h:85
#define AMD_F_INEXACT
Definition: libm_new.h:82
#define AMD_F_UNDERFLOW
Definition: libm_new.h:84
#define AMD_F_INVALID
Definition: libm_new.h:86
#define AMD_F_OVERFLOW
Definition: libm_new.h:83
#define POW_Z_INF
Definition: pow_special.c:44
#define POW_X_NAN
Definition: pow_special.c:38
#define POW_X_NEG_Y_NOTINT
Definition: pow_special.c:41
#define POW_X_NAN_Y_NAN
Definition: pow_special.c:40
#define POW_X_ZERO_Z_INF
Definition: pow_special.c:37
#define POW_Z_DENORMAL
Definition: pow_special.c:43
#define POW_Y_NAN
Definition: pow_special.c:39
#define POW_Z_ZERO
Definition: pow_special.c:42
Definition: inflate.c:139
Definition: libm_new.h:47
F64 f64
Definition: libm_new.h:48
U64 u64
Definition: libm_new.h:49

◆ _powf_special()

float _powf_special ( float  x,
float  y,
float  z,
U32  code 
)

Definition at line 46 of file pow_special.c.

47{
48 switch(code)
49 {
51 {
52 UT64 zm; zm.u64 = 0; zm.f32[0] = z;
53 _handle_errorf("powf", _FpCodePow, zm.u64, 0, AMD_F_INVALID, 0, x, y, 2);
54 }
55 break;
56
58 {
59 UT64 zm; zm.u64 = 0; zm.f32[0] = z;
61 }
62 break;
63
64 case POW_X_NAN:
65 case POW_Y_NAN:
66 case POW_X_NAN_Y_NAN:
68 {
69 UT64 zm; zm.u64 = 0; zm.f32[0] = z;
71 }
72 break;
73
74 case POW_Z_ZERO:
75 {
76 UT64 zm; zm.u64 = 0; zm.f32[0] = z;
78 }
79 break;
80
81 case POW_Z_INF:
82 {
83 UT64 zm; zm.u64 = 0; zm.f32[0] = z;
85 }
86 break;
87 }
88
89 return z;
90}
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 POW_X_ONE_Y_SNAN
Definition: pow_special.c:36
F32 f32[2]
Definition: libm_new.h:51