ReactOS 0.4.15-dev-7924-g5949c20
modf.c
Go to the documentation of this file.
1/* @(#)s_modf.c 1.3 95/01/18 */
2/*
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
5 *
6 * Developed at SunSoft, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
9 * is preserved.
10 * ====================================================
11 */
12#define modfl _dummy_modfl
13#include <precomp.h>
14#undef modfl
15
16//static const double one = 1.0;
17
18
19
20long double modfl(long double __x, long double *__i)
21{
22 union
23 {
24 long double* __x;
26 } x;
27 union
28 {
29 long double* __i;
30 long_double_s* iptr;
31 } iptr;
32
33 int j0;
34 unsigned int i;
35
36 x.__x = &__x;
37 iptr.__i = __i;
38
39
40 j0 = x.x->exponent - 0x3fff; /* exponent of x */
41
42 if(j0<32) { /* integer part in high x */
43 if(j0<0) { /* |x|<1 */
44 *__i = 0.0L;
45 iptr.iptr->sign = x.x->sign;
46 return __x;
47 } else {
48
49 i = ((unsigned int)(0xffffffff))>>(j0+1);
50 if ( x.x->mantissal == 0 && (x.x->mantissal & i) == 0 ) {
51 *__i = __x;
52 __x = 0.0L;
53 x.x->sign = iptr.iptr->sign;
54 return __x;
55 }
56 iptr.iptr->sign = x.x->sign;
57 iptr.iptr->exponent = x.x->exponent;
58 iptr.iptr->mantissah = x.x->mantissah&((~i));
59 iptr.iptr->mantissal = 0;
60
61 return __x - *__i;
62 }
63 } else if (j0>63) { /* no fraction part */
64 *__i = __x;
65 if ( _isnanl(__x) || _isinfl(__x) )
66 return __x;
67
68 __x = 0.0L;
69 x.x->sign = iptr.iptr->sign;
70 return __x;
71 } else { /* fraction part in low x */
72
73 i = ((unsigned int)(0xffffffff))>>(j0-32);
74 if ( x.x->mantissal == 0 ) {
75 *__i = __x;
76 __x = 0.0L;
77 x.x->sign = iptr.iptr->sign;
78 return __x;
79 }
80 iptr.iptr->sign = x.x->sign;
81 iptr.iptr->exponent = x.x->exponent;
82 iptr.iptr->mantissah = x.x->mantissah;
83 iptr.iptr->mantissal = x.x->mantissal&(~i);
84
85 return __x - *__i;
86 }
87}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
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 const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int _isinfl(long double)
int _isnanl(long double)
#define modfl
Definition: modf.c:12