ReactOS 0.4.15-dev-8349-g6f277e9
logbf.c File Reference
#include "libm.h"
#include "libm_util.h"
#include "libm_inlines.h"
#include "libm_errno.h"
Include dependency graph for logbf.c:

Go to the source code of this file.

Macros

#define USE_INFINITYF_WITH_FLAGS
 
#define USE_HANDLE_ERRORF
 

Functions

float _logbf (float x)
 

Macro Definition Documentation

◆ USE_HANDLE_ERRORF

#define USE_HANDLE_ERRORF

Definition at line 31 of file logbf.c.

◆ USE_INFINITYF_WITH_FLAGS

#define USE_INFINITYF_WITH_FLAGS

Definition at line 30 of file logbf.c.

Function Documentation

◆ _logbf()

float _logbf ( float  x)

Definition at line 38 of file logbf.c.

39{
40 unsigned int ux;
41 int u;
42 GET_BITS_SP32(x, ux);
44 if ((ux & ~SIGNBIT_SP32) == 0)
45 /* x is +/-zero. Return -infinity with div-by-zero flag. */
46 return _handle_errorf("_logbf", OP_LOGB, NINFBITPATT_SP32, _SING,
47 AMD_F_DIVBYZERO, ERANGE, x, 0.0F, 1);
48 else if (EMIN_SP32 <= u && u <= EMAX_SP32)
49 /* x is a normal number */
50 return (float)u;
51 else if (u > EMAX_SP32)
52 {
53 /* x is infinity or NaN */
54 if ((ux & MANTBITS_SP32) == 0)
55 /* x is +/-infinity. For VC++, return infinity of same sign. */
56 return x;
57 else
58 /* x is NaN, result is NaN */
59 return _handle_errorf("_logbf", OP_LOGB, ux|0x00400000, _DOMAIN,
60 0, EDOM, x, 0.0F, 1);
61 }
62 else
63 {
64 /* x is denormalized. */
65#ifdef FOLLOW_IEEE754_LOGB
66 /* Return the value of the minimum exponent to ensure that
67 the relationship between logb and scalb, defined in
68 IEEE 754, holds. */
69 return EMIN_SP32;
70#else
71 /* Follow the rule set by IEEE 854 for logb */
72 ux &= MANTBITS_SP32;
73 u = EMIN_SP32;
74 while (ux < IMPBIT_SP32)
75 {
76 ux <<= 1;
77 u--;
78 }
79 return (float)u;
80#endif
81 }
82}
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 ERANGE
Definition: acclib.h:92
#define EDOM
Definition: errno.h:39
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
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 * u
Definition: glfuncs.h:240
#define _DOMAIN
Definition: math.h:39
#define _SING
Definition: math.h:40
#define AMD_F_DIVBYZERO
Definition: libm_new.h:85
#define GET_BITS_SP32(x, ux)
Definition: libm_util.h:105
#define EXPBITS_SP32
Definition: libm_util.h:69
#define SIGNBIT_SP32
Definition: libm_util.h:68
#define EXPBIAS_SP32
Definition: libm_util.h:79
#define EMAX_SP32
Definition: libm_util.h:84
#define EMIN_SP32
Definition: libm_util.h:82
#define NINFBITPATT_SP32
Definition: libm_util.h:78
#define EXPSHIFTBITS_SP32
Definition: libm_util.h:80
#define MANTBITS_SP32
Definition: libm_util.h:70
#define IMPBIT_SP32
Definition: libm_util.h:74