Prevent segfault if no theme is set.
[wine/wine64.git] / dlls / msvcrt / math.c
blob2e0eaf8e01c67616faac6af414fecb52dbab78df
1 /*
2 * msvcrt.dll math functions
4 * Copyright 2000 Jon Griffiths
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include "config.h"
21 #include "msvcrt.h"
22 #include "msvcrt/errno.h"
24 #include <stdio.h>
25 #define __USE_ISOC9X 1
26 #define __USE_ISOC99 1
27 #include <math.h>
28 #ifdef HAVE_IEEEFP_H
29 #include <ieeefp.h>
30 #endif
32 #include "msvcrt/stdlib.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
38 #ifndef HAVE_FINITE
39 #ifndef finite /* Could be a macro */
40 #ifdef isfinite
41 #define finite(x) isfinite(x)
42 #else
43 #define finite(x) (!isnan(x)) /* At least catch some cases */
44 #endif
45 #endif
46 #endif
48 #ifndef signbit
49 #define signbit(x) 0
50 #endif
52 /* fpclass constants */
53 #define _FPCLASS_SNAN 1
54 #define _FPCLASS_QNAN 2
55 #define _FPCLASS_NINF 4
56 #define _FPCLASS_NN 8
57 #define _FPCLASS_ND 16
58 #define _FPCLASS_NZ 32
59 #define _FPCLASS_PZ 64
60 #define _FPCLASS_PD 128
61 #define _FPCLASS_PN 256
62 #define _FPCLASS_PINF 512
64 /* _statusfp bit flags */
65 #define _SW_INEXACT 0x1
66 #define _SW_UNDERFLOW 0x2
67 #define _SW_OVERFLOW 0x4
68 #define _SW_ZERODIVIDE 0x8
69 #define _SW_INVALID 0x10
70 #define _SW_DENORMAL 0x80000
72 /* _controlfp masks and bitflags - x86 only so far*/
73 #ifdef __i386__
74 #define _MCW_EM 0x8001f
75 #define _EM_INEXACT 0x1
76 #define _EM_UNDERFLOW 0x2
77 #define _EM_OVERFLOW 0x4
78 #define _EM_ZERODIVIDE 0x8
79 #define _EM_INVALID 0x10
81 #define _MCW_RC 0x300
82 #define _RC_NEAR 0x0
83 #define _RC_DOWN 0x100
84 #define _RC_UP 0x200
85 #define _RC_CHOP 0x300
87 #define _MCW_PC 0x30000
88 #define _PC_64 0x0
89 #define _PC_53 0x10000
90 #define _PC_24 0x20000
92 #define _MCW_IC 0x40000
93 #define _IC_AFFINE 0x40000
94 #define _IC_PROJECTIVE 0x0
96 #define _EM_DENORMAL 0x80000
97 #endif
99 typedef struct __MSVCRT_complex
101 double real;
102 double imaginary;
103 } MSVCRT_complex;
105 typedef struct __MSVCRT_exception
107 int type;
108 char *name;
109 double arg1;
110 double arg2;
111 double retval;
112 } MSVCRT_exception;
115 typedef int (*MSVCRT_matherr_func)(MSVCRT_exception *);
117 static MSVCRT_matherr_func MSVCRT_default_matherr_func = NULL;
119 #if defined(__GNUC__) && defined(__i386__)
121 #define FPU_DOUBLE(var) double var; \
122 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : )
123 #define FPU_DOUBLES(var1,var2) double var1,var2; \
124 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \
125 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : )
127 /*********************************************************************
128 * _CIacos (MSVCRT.@)
130 double _CIacos(void)
132 FPU_DOUBLE(x);
133 if (x < -1.0 || x > 1.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
134 return acos(x);
137 /*********************************************************************
138 * _CIasin (MSVCRT.@)
140 double _CIasin(void)
142 FPU_DOUBLE(x);
143 if (x < -1.0 || x > 1.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
144 return asin(x);
147 /*********************************************************************
148 * _CIatan (MSVCRT.@)
150 double _CIatan(void)
152 FPU_DOUBLE(x);
153 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
154 return atan(x);
157 /*********************************************************************
158 * _CIatan2 (MSVCRT.@)
160 double _CIatan2(void)
162 FPU_DOUBLES(x,y);
163 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
164 return atan2(x,y);
167 /*********************************************************************
168 * _CIcos (MSVCRT.@)
170 double _CIcos(void)
172 FPU_DOUBLE(x);
173 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
174 return cos(x);
177 /*********************************************************************
178 * _CIcosh (MSVCRT.@)
180 double _CIcosh(void)
182 FPU_DOUBLE(x);
183 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
184 return cosh(x);
187 /*********************************************************************
188 * _CIexp (MSVCRT.@)
190 double _CIexp(void)
192 FPU_DOUBLE(x);
193 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
194 return exp(x);
197 /*********************************************************************
198 * _CIfmod (MSVCRT.@)
200 double _CIfmod(void)
202 FPU_DOUBLES(x,y);
203 if (!finite(x) || !finite(y)) *MSVCRT__errno() = MSVCRT_EDOM;
204 return fmod(x,y);
207 /*********************************************************************
208 * _CIlog (MSVCRT.@)
210 double _CIlog(void)
212 FPU_DOUBLE(x);
213 if (x < 0.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
214 if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE;
215 return log(x);
218 /*********************************************************************
219 * _CIlog10 (MSVCRT.@)
221 double _CIlog10(void)
223 FPU_DOUBLE(x);
224 if (x < 0.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
225 if (x == 0.0) *MSVCRT__errno() = MSVCRT_ERANGE;
226 return log10(x);
229 /*********************************************************************
230 * _CIpow (MSVCRT.@)
232 double _CIpow(void)
234 double z;
235 FPU_DOUBLES(x,y);
236 /* FIXME: If x < 0 and y is not integral, set EDOM */
237 z = pow(x,y);
238 if (!finite(z)) *MSVCRT__errno() = MSVCRT_EDOM;
239 return z;
242 /*********************************************************************
243 * _CIsin (MSVCRT.@)
245 double _CIsin(void)
247 FPU_DOUBLE(x);
248 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
249 return sin(x);
252 /*********************************************************************
253 * _CIsinh (MSVCRT.@)
255 double _CIsinh(void)
257 FPU_DOUBLE(x);
258 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
259 return sinh(x);
262 /*********************************************************************
263 * _CIsqrt (MSVCRT.@)
265 double _CIsqrt(void)
267 FPU_DOUBLE(x);
268 if (x < 0.0 || !finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
269 return sqrt(x);
272 /*********************************************************************
273 * _CItan (MSVCRT.@)
275 double _CItan(void)
277 FPU_DOUBLE(x);
278 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
279 return tan(x);
282 /*********************************************************************
283 * _CItanh (MSVCRT.@)
285 double _CItanh(void)
287 FPU_DOUBLE(x);
288 if (!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM;
289 return tanh(x);
292 #else /* defined(__GNUC__) && defined(__i386__) */
294 /* The above cannot be called on non x86 platforms, stub them for linking */
296 #define IX86_ONLY(func) double func(void) { return 0.0; }
298 IX86_ONLY(_CIacos)
299 IX86_ONLY(_CIasin)
300 IX86_ONLY(_CIatan)
301 IX86_ONLY(_CIatan2)
302 IX86_ONLY(_CIcos)
303 IX86_ONLY(_CIcosh)
304 IX86_ONLY(_CIexp)
305 IX86_ONLY(_CIfmod)
306 IX86_ONLY(_CIlog)
307 IX86_ONLY(_CIlog10)
308 IX86_ONLY(_CIpow)
309 IX86_ONLY(_CIsin)
310 IX86_ONLY(_CIsinh)
311 IX86_ONLY(_CIsqrt)
312 IX86_ONLY(_CItan)
313 IX86_ONLY(_CItanh)
315 #endif /* defined(__GNUC__) && defined(__i386__) */
317 /*********************************************************************
318 * _fpclass (MSVCRT.@)
320 int _fpclass(double num)
322 #if defined(HAVE_FPCLASS) || defined(fpclass)
323 switch (fpclass( num ))
325 case FP_SNAN: return _FPCLASS_SNAN;
326 case FP_QNAN: return _FPCLASS_QNAN;
327 case FP_NINF: return _FPCLASS_NINF;
328 case FP_PINF: return _FPCLASS_PINF;
329 case FP_NDENORM: return _FPCLASS_ND;
330 case FP_PDENORM: return _FPCLASS_PD;
331 case FP_NZERO: return _FPCLASS_NZ;
332 case FP_PZERO: return _FPCLASS_PZ;
333 case FP_NNORM: return _FPCLASS_NN;
334 case FP_PNORM: return _FPCLASS_PN;
336 return _FPCLASS_PN;
337 #elif defined (fpclassify)
338 switch (fpclassify( num ))
340 case FP_NAN: return _FPCLASS_QNAN;
341 case FP_INFINITE: return signbit(num) ? _FPCLASS_NINF : _FPCLASS_PINF;
342 case FP_SUBNORMAL: return signbit(num) ?_FPCLASS_ND : _FPCLASS_PD;
343 case FP_ZERO: return signbit(num) ? _FPCLASS_NZ : _FPCLASS_PZ;
345 return signbit(num) ? _FPCLASS_NN : _FPCLASS_PN;
346 #else
347 if (!finite(num))
348 return _FPCLASS_QNAN;
349 return num == 0.0 ? _FPCLASS_PZ : (num < 0 ? _FPCLASS_NN : _FPCLASS_PN);
350 #endif
353 /*********************************************************************
354 * _rotl (MSVCRT.@)
356 unsigned int _rotl(unsigned int num, int shift)
358 shift &= 31;
359 return (num << shift) | (num >> (32-shift));
362 /*********************************************************************
363 * _logb (MSVCRT.@)
365 double _logb(double num)
367 if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
368 return logb(num);
371 /*********************************************************************
372 * _lrotl (MSVCRT.@)
374 unsigned long _lrotl(unsigned long num, int shift)
376 shift &= 0x1f;
377 return (num << shift) | (num >> (32-shift));
380 /*********************************************************************
381 * _lrotr (MSVCRT.@)
383 unsigned long _lrotr(unsigned long num, int shift)
385 shift &= 0x1f;
386 return (num >> shift) | (num << (32-shift));
389 /*********************************************************************
390 * _rotr (MSVCRT.@)
392 unsigned int _rotr(unsigned int num, int shift)
394 shift &= 0x1f;
395 return (num >> shift) | (num << (32-shift));
398 /*********************************************************************
399 * _scalb (MSVCRT.@)
401 double _scalb(double num, long power)
403 /* Note - Can't forward directly as libc expects y as double */
404 double dblpower = (double)power;
405 if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
406 return scalb(num, dblpower);
409 /*********************************************************************
410 * _matherr (MSVCRT.@)
412 int _matherr(MSVCRT_exception *e)
414 if (e)
415 TRACE("(%p = %d, %s, %g %g %g)\n",e, e->type, e->name, e->arg1, e->arg2,
416 e->retval);
417 else
418 TRACE("(null)\n");
419 if (MSVCRT_default_matherr_func)
420 return MSVCRT_default_matherr_func(e);
421 ERR(":Unhandled math error!\n");
422 return 0;
425 /*********************************************************************
426 * __setusermatherr (MSVCRT.@)
428 void MSVCRT___setusermatherr(MSVCRT_matherr_func func)
430 MSVCRT_default_matherr_func = func;
431 TRACE(":new matherr handler %p\n", func);
434 /**********************************************************************
435 * _statusfp (MSVCRT.@)
437 unsigned int _statusfp(void)
439 unsigned int retVal = 0;
440 #if defined(__GNUC__) && defined(__i386__)
441 unsigned int fpword;
443 __asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
444 if (fpword & 0x1) retVal |= _SW_INVALID;
445 if (fpword & 0x2) retVal |= _SW_DENORMAL;
446 if (fpword & 0x4) retVal |= _SW_ZERODIVIDE;
447 if (fpword & 0x8) retVal |= _SW_OVERFLOW;
448 if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
449 if (fpword & 0x20) retVal |= _SW_INEXACT;
450 #else
451 FIXME(":Not implemented!\n");
452 #endif
453 return retVal;
456 /*********************************************************************
457 * _clearfp (MSVCRT.@)
459 unsigned int _clearfp(void)
461 unsigned int retVal = _statusfp();
462 #if defined(__GNUC__) && defined(__i386__)
463 __asm__ __volatile__( "fnclex" );
464 #else
465 FIXME(":Not Implemented\n");
466 #endif
467 return retVal;
470 /*********************************************************************
471 * __fpecode (MSVCRT.@)
473 int *__fpecode(void)
475 return &msvcrt_get_thread_data()->fpecode;
478 /*********************************************************************
479 * ldexp (MSVCRT.@)
481 double MSVCRT_ldexp(double num, long exp)
483 double z = ldexp(num,exp);
485 if (!finite(z))
486 *MSVCRT__errno() = MSVCRT_ERANGE;
487 else if (z == 0 && signbit(z))
488 z = 0.0; /* Convert -0 -> +0 */
489 return z;
492 /*********************************************************************
493 * _cabs (MSVCRT.@)
495 double _cabs(MSVCRT_complex num)
497 return sqrt(num.real * num.real + num.imaginary * num.imaginary);
500 /*********************************************************************
501 * _chgsign (MSVCRT.@)
503 double _chgsign(double num)
505 /* FIXME: +-infinity,Nan not tested */
506 return -num;
509 /*********************************************************************
510 * _control87 (MSVCRT.@)
512 unsigned int _control87(unsigned int newval, unsigned int mask)
514 #if defined(__GNUC__) && defined(__i386__)
515 unsigned int fpword = 0;
516 unsigned int flags = 0;
518 TRACE("(%08x, %08x): Called\n", newval, mask);
520 /* Get fp control word */
521 __asm__ __volatile__( "fstcw %0" : "=m" (fpword) : );
523 TRACE("Control word before : %08x\n", fpword);
525 /* Convert into mask constants */
526 if (fpword & 0x1) flags |= _EM_INVALID;
527 if (fpword & 0x2) flags |= _EM_DENORMAL;
528 if (fpword & 0x4) flags |= _EM_ZERODIVIDE;
529 if (fpword & 0x8) flags |= _EM_OVERFLOW;
530 if (fpword & 0x10) flags |= _EM_UNDERFLOW;
531 if (fpword & 0x20) flags |= _EM_INEXACT;
532 switch(fpword & 0xC00) {
533 case 0xC00: flags |= _RC_UP|_RC_DOWN; break;
534 case 0x800: flags |= _RC_UP; break;
535 case 0x400: flags |= _RC_DOWN; break;
537 switch(fpword & 0x300) {
538 case 0x0: flags |= _PC_24; break;
539 case 0x200: flags |= _PC_53; break;
540 case 0x300: flags |= _PC_64; break;
542 if (fpword & 0x1000) flags |= _IC_AFFINE;
544 /* Mask with parameters */
545 flags = (flags & ~mask) | (newval & mask);
547 /* Convert (masked) value back to fp word */
548 fpword = 0;
549 if (flags & _EM_INVALID) fpword |= 0x1;
550 if (flags & _EM_DENORMAL) fpword |= 0x2;
551 if (flags & _EM_ZERODIVIDE) fpword |= 0x4;
552 if (flags & _EM_OVERFLOW) fpword |= 0x8;
553 if (flags & _EM_UNDERFLOW) fpword |= 0x10;
554 if (flags & _EM_INEXACT) fpword |= 0x20;
555 switch(flags & (_RC_UP | _RC_DOWN)) {
556 case _RC_UP|_RC_DOWN: fpword |= 0xC00; break;
557 case _RC_UP: fpword |= 0x800; break;
558 case _RC_DOWN: fpword |= 0x400; break;
560 switch (flags & (_PC_24 | _PC_53)) {
561 case _PC_64: fpword |= 0x300; break;
562 case _PC_53: fpword |= 0x200; break;
563 case _PC_24: fpword |= 0x0; break;
565 if (flags & _IC_AFFINE) fpword |= 0x1000;
567 TRACE("Control word after : %08x\n", fpword);
569 /* Put fp control word */
570 __asm__ __volatile__( "fldcw %0" : : "m" (fpword) );
572 return flags;
573 #else
574 FIXME(":Not Implemented!\n");
575 return 0;
576 #endif
579 /*********************************************************************
580 * _controlfp (MSVCRT.@)
582 unsigned int _controlfp(unsigned int newval, unsigned int mask)
584 #ifdef __i386__
585 return _control87( newval, mask & ~_EM_DENORMAL );
586 #else
587 FIXME(":Not Implemented!\n");
588 return 0;
589 #endif
592 /*********************************************************************
593 * _copysign (MSVCRT.@)
595 double _copysign(double num, double sign)
597 /* FIXME: Behaviour for Nan/Inf? */
598 if (sign < 0.0)
599 return num < 0.0 ? num : -num;
600 return num < 0.0 ? -num : num;
603 /*********************************************************************
604 * _finite (MSVCRT.@)
606 int _finite(double num)
608 return (finite(num)?1:0); /* See comment for _isnan() */
611 /*********************************************************************
612 * _fpreset (MSVCRT.@)
614 void _fpreset(void)
616 #if defined(__GNUC__) && defined(__i386__)
617 __asm__ __volatile__( "fninit" );
618 #else
619 FIXME(":Not Implemented!\n");
620 #endif
623 /*********************************************************************
624 * _isnan (MSVCRT.@)
626 INT _isnan(double num)
628 /* Some implementations return -1 for true(glibc), msvcrt/crtdll return 1.
629 * Do the same, as the result may be used in calculations
631 return isnan(num) ? 1 : 0;
634 /*********************************************************************
635 * _y0 (MSVCRT.@)
637 double _y0(double num)
639 double retval;
640 if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
641 retval = y0(num);
642 if (_fpclass(retval) == _FPCLASS_NINF)
644 *MSVCRT__errno() = MSVCRT_EDOM;
645 retval = sqrt(-1);
647 return retval;
650 /*********************************************************************
651 * _y1 (MSVCRT.@)
653 double _y1(double num)
655 double retval;
656 if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
657 retval = y1(num);
658 if (_fpclass(retval) == _FPCLASS_NINF)
660 *MSVCRT__errno() = MSVCRT_EDOM;
661 retval = sqrt(-1);
663 return retval;
666 /*********************************************************************
667 * _yn (MSVCRT.@)
669 double _yn(int order, double num)
671 double retval;
672 if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
673 retval = yn(order,num);
674 if (_fpclass(retval) == _FPCLASS_NINF)
676 *MSVCRT__errno() = MSVCRT_EDOM;
677 retval = sqrt(-1);
679 return retval;
682 /*********************************************************************
683 * _nextafter (MSVCRT.@)
685 double _nextafter(double num, double next)
687 double retval;
688 if (!finite(num) || !finite(next)) *MSVCRT__errno() = MSVCRT_EDOM;
689 retval = nextafter(num,next);
690 return retval;
693 /*********************************************************************
694 * _ecvt (MSVCRT.@)
696 char *_ecvt( double number, int ndigits, int *decpt, int *sign )
698 MSVCRT_thread_data *data = msvcrt_get_thread_data();
699 char *dec;
701 if (!data->efcvt_buffer)
702 data->efcvt_buffer = MSVCRT_malloc( 80 ); /* ought to be enough */
704 snprintf(data->efcvt_buffer, 80, "%.*e", ndigits /* FIXME wrong */, number);
705 *sign = (number < 0);
706 dec = strchr(data->efcvt_buffer, '.');
707 *decpt = (dec) ? dec - data->efcvt_buffer : -1;
708 return data->efcvt_buffer;
711 /***********************************************************************
712 * _fcvt (MSVCRT.@)
714 char *_fcvt( double number, int ndigits, int *decpt, int *sign )
716 MSVCRT_thread_data *data = msvcrt_get_thread_data();
717 char *dec;
719 if (!data->efcvt_buffer)
720 data->efcvt_buffer = MSVCRT_malloc( 80 ); /* ought to be enough */
722 snprintf(data->efcvt_buffer, 80, "%.*e", ndigits, number);
723 *sign = (number < 0);
724 dec = strchr(data->efcvt_buffer, '.');
725 *decpt = (dec) ? dec - data->efcvt_buffer : -1;
726 return data->efcvt_buffer;
729 /***********************************************************************
730 * _gcvt (MSVCRT.@)
732 * FIXME: uses both E and F.
734 char *_gcvt( double number, int ndigit, char *buff )
736 sprintf(buff, "%.*E", ndigit, number);
737 return buff;
740 #include <stdlib.h> /* div_t, ldiv_t */
742 /*********************************************************************
743 * div (MSVCRT.@)
744 * VERSION
745 * [i386] Windows binary compatible - returns the struct in eax/edx.
747 #ifdef __i386__
748 unsigned __int64 MSVCRT_div(int num, int denom)
750 div_t dt = div(num,denom);
751 return ((unsigned __int64)dt.rem << 32) | (unsigned int)dt.quot;
753 #else
754 /*********************************************************************
755 * div (MSVCRT.@)
756 * VERSION
757 * [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility
759 MSVCRT_div_t MSVCRT_div(int num, int denom)
761 div_t dt = div(num,denom);
762 MSVCRT_div_t ret;
763 ret.quot = dt.quot;
764 ret.rem = dt.rem;
766 return ret;
769 #endif /* ifdef __i386__ */
772 /*********************************************************************
773 * ldiv (MSVCRT.@)
774 * VERSION
775 * [i386] Windows binary compatible - returns the struct in eax/edx.
777 #ifdef __i386__
778 unsigned __int64 MSVCRT_ldiv(long num, long denom)
780 ldiv_t ldt = ldiv(num,denom);
781 return ((unsigned __int64)ldt.rem << 32) | (unsigned long)ldt.quot;
783 #else
784 /*********************************************************************
785 * ldiv (MSVCRT.@)
786 * VERSION
787 * [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility
789 MSVCRT_ldiv_t MSVCRT_ldiv(long num, long denom)
791 ldiv_t result = ldiv(num,denom);
793 MSVCRT_ldiv_t ret;
794 ret.quot = result.quot;
795 ret.rem = result.rem;
797 return ret;
799 #endif /* ifdef __i386__ */
801 /***********************************************************************
802 * _adj_fdiv_m16i (MSVCRT.@)
803 * FIXME
804 * This function is likely to have the wrong number of arguments.
806 * NOTE
807 * I _think_ this function is intended to work around the Pentium
808 * fdiv bug.
810 void _adj_fdiv_m16i(void)
812 TRACE("(): stub\n");
815 /***********************************************************************
816 * _adj_fdiv_m32 (MSVCRT.@)
817 * FIXME
818 * This function is likely to have the wrong number of arguments.
820 * NOTE
821 * I _think_ this function is intended to work around the Pentium
822 * fdiv bug.
824 void _adj_fdiv_m32(void)
826 TRACE("(): stub\n");
829 /***********************************************************************
830 * _adj_fdiv_m32i (MSVCRT.@)
831 * FIXME
832 * This function is likely to have the wrong number of arguments.
834 * NOTE
835 * I _think_ this function is intended to work around the Pentium
836 * fdiv bug.
838 void _adj_fdiv_m32i(void)
840 TRACE("(): stub\n");
843 /***********************************************************************
844 * _adj_fdiv_m64 (MSVCRT.@)
845 * FIXME
846 * This function is likely to have the wrong number of arguments.
848 * NOTE
849 * I _think_ this function is intended to work around the Pentium
850 * fdiv bug.
852 void _adj_fdiv_m64(void)
854 TRACE("(): stub\n");
857 /***********************************************************************
858 * _adj_fdiv_r (MSVCRT.@)
859 * FIXME
860 * This function is likely to have the wrong number of arguments.
862 * NOTE
863 * I _think_ this function is intended to work around the Pentium
864 * fdiv bug.
866 void _adj_fdiv_r(void)
868 TRACE("(): stub\n");
871 /***********************************************************************
872 * _adj_fdivr_m16i (MSVCRT.@)
873 * FIXME
874 * This function is likely to have the wrong number of arguments.
876 * NOTE
877 * I _think_ this function is intended to work around the Pentium
878 * fdiv bug.
880 void _adj_fdivr_m16i(void)
882 TRACE("(): stub\n");
885 /***********************************************************************
886 * _adj_fdivr_m32 (MSVCRT.@)
887 * FIXME
888 * This function is likely to have the wrong number of arguments.
890 * NOTE
891 * I _think_ this function is intended to work around the Pentium
892 * fdiv bug.
894 void _adj_fdivr_m32(void)
896 TRACE("(): stub\n");
899 /***********************************************************************
900 * _adj_fdivr_m32i (MSVCRT.@)
901 * FIXME
902 * This function is likely to have the wrong number of arguments.
904 * NOTE
905 * I _think_ this function is intended to work around the Pentium
906 * fdiv bug.
908 void _adj_fdivr_m32i(void)
910 TRACE("(): stub\n");
913 /***********************************************************************
914 * _adj_fdivr_m64 (MSVCRT.@)
915 * FIXME
916 * This function is likely to have the wrong number of arguments.
918 * NOTE
919 * I _think_ this function is intended to work around the Pentium
920 * fdiv bug.
922 void _adj_fdivr_m64(void)
924 TRACE("(): stub\n");
927 /***********************************************************************
928 * _adj_fpatan (MSVCRT.@)
929 * FIXME
930 * This function is likely to have the wrong number of arguments.
932 * NOTE
933 * I _think_ this function is intended to work around the Pentium
934 * fdiv bug.
936 void _adj_fpatan(void)
938 TRACE("(): stub\n");
941 /***********************************************************************
942 * _adj_fprem (MSVCRT.@)
943 * FIXME
944 * This function is likely to have the wrong number of arguments.
946 * NOTE
947 * I _think_ this function is intended to work around the Pentium
948 * fdiv bug.
950 void _adj_fprem(void)
952 TRACE("(): stub\n");
955 /***********************************************************************
956 * _adj_fprem1 (MSVCRT.@)
957 * FIXME
958 * This function is likely to have the wrong number of arguments.
960 * NOTE
961 * I _think_ this function is intended to work around the Pentium
962 * fdiv bug.
964 void _adj_fprem1(void)
966 TRACE("(): stub\n");
969 /***********************************************************************
970 * _adj_fptan (MSVCRT.@)
971 * FIXME
972 * This function is likely to have the wrong number of arguments.
974 * NOTE
975 * I _think_ this function is intended to work around the Pentium
976 * fdiv bug.
978 void _adj_fptan(void)
980 TRACE("(): stub\n");
983 /***********************************************************************
984 * _adjust_fdiv (MSVCRT.@)
985 * FIXME
986 * I _think_ this function should be a variable indicating whether
987 * Pentium fdiv bug safe code should be used.
989 void _adjust_fdiv(void)
991 TRACE("(): stub\n");
994 /***********************************************************************
995 * _safe_fdiv (MSVCRT.@)
996 * FIXME
997 * This function is likely to have the wrong number of arguments.
999 * NOTE
1000 * I _think_ this function is intended to work around the Pentium
1001 * fdiv bug.
1003 void _safe_fdiv(void)
1005 TRACE("(): stub\n");
1008 /***********************************************************************
1009 * _safe_fdivr (MSVCRT.@)
1010 * FIXME
1011 * This function is likely to have the wrong number of arguments.
1013 * NOTE
1014 * I _think_ this function is intended to work around the Pentium
1015 * fdiv bug.
1017 void _safe_fdivr(void)
1019 TRACE("(): stub\n");
1022 /***********************************************************************
1023 * _safe_fprem (MSVCRT.@)
1024 * FIXME
1025 * This function is likely to have the wrong number of arguments.
1027 * NOTE
1028 * I _think_ this function is intended to work around the Pentium
1029 * fdiv bug.
1031 void _safe_fprem(void)
1033 TRACE("(): stub\n");
1036 /***********************************************************************
1037 * _safe_fprem1 (MSVCRT.@)
1039 * FIXME
1040 * This function is likely to have the wrong number of arguments.
1042 * NOTE
1043 * I _think_ this function is intended to work around the Pentium
1044 * fdiv bug.
1046 void _safe_fprem1(void)
1048 TRACE("(): stub\n");