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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #define __USE_ISOC9X 1
24 #define __USE_ISOC99 1
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt
);
37 #ifndef finite /* Could be a macro */
39 #define finite(x) isfinite(x)
41 #define finite(x) (!isnan(x)) /* At least catch some cases */
50 typedef int (*MSVCRT_matherr_func
)(struct MSVCRT__exception
*);
52 static MSVCRT_matherr_func MSVCRT_default_matherr_func
= NULL
;
54 /*********************************************************************
55 * MSVCRT_acos (MSVCRT.@)
57 double CDECL
MSVCRT_acos( double x
)
59 if (x
< -1.0 || x
> 1.0 || !finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
63 /*********************************************************************
64 * MSVCRT_asin (MSVCRT.@)
66 double CDECL
MSVCRT_asin( double x
)
68 if (x
< -1.0 || x
> 1.0 || !finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
72 /*********************************************************************
73 * MSVCRT_atan (MSVCRT.@)
75 double CDECL
MSVCRT_atan( double x
)
77 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
81 /*********************************************************************
82 * MSVCRT_atan2 (MSVCRT.@)
84 double CDECL
MSVCRT_atan2( double x
, double y
)
86 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
90 /*********************************************************************
91 * MSVCRT_cos (MSVCRT.@)
93 double CDECL
MSVCRT_cos( double x
)
95 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
99 /*********************************************************************
100 * MSVCRT_cosh (MSVCRT.@)
102 double CDECL
MSVCRT_cosh( double x
)
104 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
108 /*********************************************************************
109 * MSVCRT_exp (MSVCRT.@)
111 double CDECL
MSVCRT_exp( double x
)
113 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
117 /*********************************************************************
118 * MSVCRT_fmod (MSVCRT.@)
120 double CDECL
MSVCRT_fmod( double x
, double y
)
122 if (!finite(x
) || !finite(y
)) *MSVCRT__errno() = MSVCRT_EDOM
;
126 /*********************************************************************
127 * MSVCRT_log (MSVCRT.@)
129 double CDECL
MSVCRT_log( double x
)
131 if (x
< 0.0 || !finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
132 if (x
== 0.0) *MSVCRT__errno() = MSVCRT_ERANGE
;
136 /*********************************************************************
137 * MSVCRT_log10 (MSVCRT.@)
139 double CDECL
MSVCRT_log10( double x
)
141 if (x
< 0.0 || !finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
142 if (x
== 0.0) *MSVCRT__errno() = MSVCRT_ERANGE
;
146 /*********************************************************************
147 * MSVCRT_pow (MSVCRT.@)
149 double CDECL
MSVCRT_pow( double x
, double y
)
151 /* FIXME: If x < 0 and y is not integral, set EDOM */
153 if (!finite(z
)) *MSVCRT__errno() = MSVCRT_EDOM
;
157 /*********************************************************************
158 * MSVCRT_sin (MSVCRT.@)
160 double CDECL
MSVCRT_sin( double x
)
162 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
166 /*********************************************************************
167 * MSVCRT_sinh (MSVCRT.@)
169 double CDECL
MSVCRT_sinh( double x
)
171 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
175 /*********************************************************************
176 * MSVCRT_sqrt (MSVCRT.@)
178 double CDECL
MSVCRT_sqrt( double x
)
180 if (x
< 0.0 || !finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
184 /*********************************************************************
185 * MSVCRT_tan (MSVCRT.@)
187 double CDECL
MSVCRT_tan( double x
)
189 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
193 /*********************************************************************
194 * MSVCRT_tanh (MSVCRT.@)
196 double CDECL
MSVCRT_tanh( double x
)
198 if (!finite(x
)) *MSVCRT__errno() = MSVCRT_EDOM
;
203 #if defined(__GNUC__) && defined(__i386__)
205 #define FPU_DOUBLE(var) double var; \
206 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : )
207 #define FPU_DOUBLES(var1,var2) double var1,var2; \
208 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \
209 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : )
211 /*********************************************************************
214 double CDECL
_CIacos(void)
217 return MSVCRT_acos(x
);
220 /*********************************************************************
223 double CDECL
_CIasin(void)
226 return MSVCRT_asin(x
);
229 /*********************************************************************
232 double CDECL
_CIatan(void)
235 return MSVCRT_atan(x
);
238 /*********************************************************************
239 * _CIatan2 (MSVCRT.@)
241 double CDECL
_CIatan2(void)
244 return MSVCRT_atan2(x
,y
);
247 /*********************************************************************
250 double CDECL
_CIcos(void)
253 return MSVCRT_cos(x
);
256 /*********************************************************************
259 double CDECL
_CIcosh(void)
262 return MSVCRT_cosh(x
);
265 /*********************************************************************
268 double CDECL
_CIexp(void)
271 return MSVCRT_exp(x
);
274 /*********************************************************************
277 double CDECL
_CIfmod(void)
280 return MSVCRT_fmod(x
,y
);
283 /*********************************************************************
286 double CDECL
_CIlog(void)
289 return MSVCRT_log(x
);
292 /*********************************************************************
293 * _CIlog10 (MSVCRT.@)
295 double CDECL
_CIlog10(void)
298 return MSVCRT_log10(x
);
301 /*********************************************************************
304 double CDECL
_CIpow(void)
307 return MSVCRT_pow(x
,y
);
310 /*********************************************************************
313 double CDECL
_CIsin(void)
316 return MSVCRT_sin(x
);
319 /*********************************************************************
322 double CDECL
_CIsinh(void)
325 return MSVCRT_sinh(x
);
328 /*********************************************************************
331 double CDECL
_CIsqrt(void)
334 return MSVCRT_sqrt(x
);
337 /*********************************************************************
340 double CDECL
_CItan(void)
343 return MSVCRT_tan(x
);
346 /*********************************************************************
349 double CDECL
_CItanh(void)
352 return MSVCRT_tanh(x
);
355 #else /* defined(__GNUC__) && defined(__i386__) */
357 /* The above cannot be called on non x86 platforms, stub them for linking */
359 #define IX86_ONLY(func) double func(void) { return 0.0; }
378 #endif /* defined(__GNUC__) && defined(__i386__) */
380 /*********************************************************************
381 * _fpclass (MSVCRT.@)
383 int CDECL
_fpclass(double num
)
385 #if defined(HAVE_FPCLASS) || defined(fpclass)
386 switch (fpclass( num
))
389 case FP_SNAN
: return MSVCRT__FPCLASS_SNAN
;
392 case FP_QNAN
: return MSVCRT__FPCLASS_QNAN
;
395 case FP_NINF
: return MSVCRT__FPCLASS_NINF
;
398 case FP_PINF
: return MSVCRT__FPCLASS_PINF
;
401 case FP_NDENORM
: return MSVCRT__FPCLASS_ND
;
404 case FP_PDENORM
: return MSVCRT__FPCLASS_PD
;
407 case FP_NZERO
: return MSVCRT__FPCLASS_NZ
;
410 case FP_PZERO
: return MSVCRT__FPCLASS_PZ
;
413 case FP_NNORM
: return MSVCRT__FPCLASS_NN
;
416 case FP_PNORM
: return MSVCRT__FPCLASS_PN
;
419 return MSVCRT__FPCLASS_PN
;
420 #elif defined (fpclassify)
421 switch (fpclassify( num
))
423 case FP_NAN
: return MSVCRT__FPCLASS_QNAN
;
424 case FP_INFINITE
: return signbit(num
) ? MSVCRT__FPCLASS_NINF
: MSVCRT__FPCLASS_PINF
;
425 case FP_SUBNORMAL
: return signbit(num
) ?MSVCRT__FPCLASS_ND
: MSVCRT__FPCLASS_PD
;
426 case FP_ZERO
: return signbit(num
) ? MSVCRT__FPCLASS_NZ
: MSVCRT__FPCLASS_PZ
;
428 return signbit(num
) ? MSVCRT__FPCLASS_NN
: MSVCRT__FPCLASS_PN
;
431 return MSVCRT__FPCLASS_QNAN
;
432 return num
== 0.0 ? MSVCRT__FPCLASS_PZ
: (num
< 0 ? MSVCRT__FPCLASS_NN
: MSVCRT__FPCLASS_PN
);
436 /*********************************************************************
439 unsigned int CDECL
_rotl(unsigned int num
, int shift
)
442 return (num
<< shift
) | (num
>> (32-shift
));
445 /*********************************************************************
448 double CDECL
_logb(double num
)
450 if (!finite(num
)) *MSVCRT__errno() = MSVCRT_EDOM
;
454 /*********************************************************************
457 unsigned long CDECL
_lrotl(unsigned long num
, int shift
)
460 return (num
<< shift
) | (num
>> (32-shift
));
463 /*********************************************************************
466 unsigned long CDECL
_lrotr(unsigned long num
, int shift
)
469 return (num
>> shift
) | (num
<< (32-shift
));
472 /*********************************************************************
475 unsigned int CDECL
_rotr(unsigned int num
, int shift
)
478 return (num
>> shift
) | (num
<< (32-shift
));
481 /*********************************************************************
484 double CDECL
_scalb(double num
, long power
)
486 /* Note - Can't forward directly as libc expects y as double */
487 double dblpower
= (double)power
;
488 if (!finite(num
)) *MSVCRT__errno() = MSVCRT_EDOM
;
489 return scalb(num
, dblpower
);
492 /*********************************************************************
495 double CDECL
_hypot(double x
, double y
)
497 /* FIXME: errno handling */
498 return hypot( x
, y
);
501 /*********************************************************************
504 double CDECL
MSVCRT_ceil( double x
)
509 /*********************************************************************
512 double CDECL
MSVCRT_floor( double x
)
517 /*********************************************************************
520 double CDECL
MSVCRT_fabs( double x
)
525 /*********************************************************************
528 double CDECL
MSVCRT_frexp( double x
, int *exp
)
530 return frexp( x
, exp
);
533 /*********************************************************************
536 double CDECL
MSVCRT_modf( double x
, double *iptr
)
538 return modf( x
, iptr
);
541 /*********************************************************************
542 * _matherr (MSVCRT.@)
544 int CDECL
MSVCRT__matherr(struct MSVCRT__exception
*e
)
547 TRACE("(%p = %d, %s, %g %g %g)\n",e
, e
->type
, e
->name
, e
->arg1
, e
->arg2
,
551 if (MSVCRT_default_matherr_func
)
552 return MSVCRT_default_matherr_func(e
);
553 ERR(":Unhandled math error!\n");
557 /*********************************************************************
558 * __setusermatherr (MSVCRT.@)
560 void CDECL
MSVCRT___setusermatherr(MSVCRT_matherr_func func
)
562 MSVCRT_default_matherr_func
= func
;
563 TRACE(":new matherr handler %p\n", func
);
566 /**********************************************************************
567 * _statusfp (MSVCRT.@)
569 unsigned int CDECL
_statusfp(void)
571 unsigned int retVal
= 0;
572 #if defined(__GNUC__) && defined(__i386__)
575 __asm__
__volatile__( "fstsw %0" : "=m" (fpword
) : );
576 if (fpword
& 0x1) retVal
|= MSVCRT__SW_INVALID
;
577 if (fpword
& 0x2) retVal
|= MSVCRT__SW_DENORMAL
;
578 if (fpword
& 0x4) retVal
|= MSVCRT__SW_ZERODIVIDE
;
579 if (fpword
& 0x8) retVal
|= MSVCRT__SW_OVERFLOW
;
580 if (fpword
& 0x10) retVal
|= MSVCRT__SW_UNDERFLOW
;
581 if (fpword
& 0x20) retVal
|= MSVCRT__SW_INEXACT
;
583 FIXME(":Not implemented!\n");
588 /*********************************************************************
589 * _clearfp (MSVCRT.@)
591 unsigned int CDECL
_clearfp(void)
593 unsigned int retVal
= _statusfp();
594 #if defined(__GNUC__) && defined(__i386__)
595 __asm__
__volatile__( "fnclex" );
597 FIXME(":Not Implemented\n");
602 /*********************************************************************
603 * __fpecode (MSVCRT.@)
605 int * CDECL
__fpecode(void)
607 return &msvcrt_get_thread_data()->fpecode
;
610 /*********************************************************************
613 double CDECL
MSVCRT_ldexp(double num
, long exp
)
615 double z
= ldexp(num
,exp
);
618 *MSVCRT__errno() = MSVCRT_ERANGE
;
619 else if (z
== 0 && signbit(z
))
620 z
= 0.0; /* Convert -0 -> +0 */
624 /*********************************************************************
627 double CDECL
MSVCRT__cabs(struct MSVCRT__complex num
)
629 return sqrt(num
.x
* num
.x
+ num
.y
* num
.y
);
632 /*********************************************************************
633 * _chgsign (MSVCRT.@)
635 double CDECL
_chgsign(double num
)
637 /* FIXME: +-infinity,Nan not tested */
641 /*********************************************************************
642 * _control87 (MSVCRT.@)
644 unsigned int CDECL
_control87(unsigned int newval
, unsigned int mask
)
646 #if defined(__GNUC__) && defined(__i386__)
647 unsigned int fpword
= 0;
648 unsigned int flags
= 0;
650 TRACE("(%08x, %08x): Called\n", newval
, mask
);
652 /* Get fp control word */
653 __asm__
__volatile__( "fstcw %0" : "=m" (fpword
) : );
655 TRACE("Control word before : %08x\n", fpword
);
657 /* Convert into mask constants */
658 if (fpword
& 0x1) flags
|= MSVCRT__EM_INVALID
;
659 if (fpword
& 0x2) flags
|= MSVCRT__EM_DENORMAL
;
660 if (fpword
& 0x4) flags
|= MSVCRT__EM_ZERODIVIDE
;
661 if (fpword
& 0x8) flags
|= MSVCRT__EM_OVERFLOW
;
662 if (fpword
& 0x10) flags
|= MSVCRT__EM_UNDERFLOW
;
663 if (fpword
& 0x20) flags
|= MSVCRT__EM_INEXACT
;
664 switch(fpword
& 0xC00) {
665 case 0xC00: flags
|= MSVCRT__RC_UP
|MSVCRT__RC_DOWN
; break;
666 case 0x800: flags
|= MSVCRT__RC_UP
; break;
667 case 0x400: flags
|= MSVCRT__RC_DOWN
; break;
669 switch(fpword
& 0x300) {
670 case 0x0: flags
|= MSVCRT__PC_24
; break;
671 case 0x200: flags
|= MSVCRT__PC_53
; break;
672 case 0x300: flags
|= MSVCRT__PC_64
; break;
674 if (fpword
& 0x1000) flags
|= MSVCRT__IC_AFFINE
;
676 /* Mask with parameters */
677 flags
= (flags
& ~mask
) | (newval
& mask
);
679 /* Convert (masked) value back to fp word */
681 if (flags
& MSVCRT__EM_INVALID
) fpword
|= 0x1;
682 if (flags
& MSVCRT__EM_DENORMAL
) fpword
|= 0x2;
683 if (flags
& MSVCRT__EM_ZERODIVIDE
) fpword
|= 0x4;
684 if (flags
& MSVCRT__EM_OVERFLOW
) fpword
|= 0x8;
685 if (flags
& MSVCRT__EM_UNDERFLOW
) fpword
|= 0x10;
686 if (flags
& MSVCRT__EM_INEXACT
) fpword
|= 0x20;
687 switch(flags
& (MSVCRT__RC_UP
| MSVCRT__RC_DOWN
)) {
688 case MSVCRT__RC_UP
|MSVCRT__RC_DOWN
: fpword
|= 0xC00; break;
689 case MSVCRT__RC_UP
: fpword
|= 0x800; break;
690 case MSVCRT__RC_DOWN
: fpword
|= 0x400; break;
692 switch (flags
& (MSVCRT__PC_24
| MSVCRT__PC_53
)) {
693 case MSVCRT__PC_64
: fpword
|= 0x300; break;
694 case MSVCRT__PC_53
: fpword
|= 0x200; break;
695 case MSVCRT__PC_24
: fpword
|= 0x0; break;
697 if (flags
& MSVCRT__IC_AFFINE
) fpword
|= 0x1000;
699 TRACE("Control word after : %08x\n", fpword
);
701 /* Put fp control word */
702 __asm__
__volatile__( "fldcw %0" : : "m" (fpword
) );
706 FIXME(":Not Implemented!\n");
711 /*********************************************************************
712 * _controlfp (MSVCRT.@)
714 unsigned int CDECL
_controlfp(unsigned int newval
, unsigned int mask
)
717 return _control87( newval
, mask
& ~MSVCRT__EM_DENORMAL
);
719 FIXME(":Not Implemented!\n");
724 /*********************************************************************
725 * _copysign (MSVCRT.@)
727 double CDECL
_copysign(double num
, double sign
)
729 /* FIXME: Behaviour for Nan/Inf? */
731 return num
< 0.0 ? num
: -num
;
732 return num
< 0.0 ? -num
: num
;
735 /*********************************************************************
738 int CDECL
_finite(double num
)
740 return (finite(num
)?1:0); /* See comment for _isnan() */
743 /*********************************************************************
744 * _fpreset (MSVCRT.@)
746 void CDECL
_fpreset(void)
748 #if defined(__GNUC__) && defined(__i386__)
749 __asm__
__volatile__( "fninit" );
751 FIXME(":Not Implemented!\n");
755 /*********************************************************************
758 INT CDECL
_isnan(double num
)
760 /* Some implementations return -1 for true(glibc), msvcrt/crtdll return 1.
761 * Do the same, as the result may be used in calculations
763 return isnan(num
) ? 1 : 0;
766 /*********************************************************************
769 double CDECL
_j0(double num
)
771 /* FIXME: errno handling */
775 /*********************************************************************
778 double CDECL
_j1(double num
)
780 /* FIXME: errno handling */
784 /*********************************************************************
787 double CDECL
_jn(int n
, double num
)
789 /* FIXME: errno handling */
793 /*********************************************************************
796 double CDECL
_y0(double num
)
799 if (!finite(num
)) *MSVCRT__errno() = MSVCRT_EDOM
;
801 if (_fpclass(retval
) == MSVCRT__FPCLASS_NINF
)
803 *MSVCRT__errno() = MSVCRT_EDOM
;
809 /*********************************************************************
812 double CDECL
_y1(double num
)
815 if (!finite(num
)) *MSVCRT__errno() = MSVCRT_EDOM
;
817 if (_fpclass(retval
) == MSVCRT__FPCLASS_NINF
)
819 *MSVCRT__errno() = MSVCRT_EDOM
;
825 /*********************************************************************
828 double CDECL
_yn(int order
, double num
)
831 if (!finite(num
)) *MSVCRT__errno() = MSVCRT_EDOM
;
832 retval
= yn(order
,num
);
833 if (_fpclass(retval
) == MSVCRT__FPCLASS_NINF
)
835 *MSVCRT__errno() = MSVCRT_EDOM
;
841 /*********************************************************************
842 * _nextafter (MSVCRT.@)
844 double CDECL
_nextafter(double num
, double next
)
847 if (!finite(num
) || !finite(next
)) *MSVCRT__errno() = MSVCRT_EDOM
;
848 retval
= nextafter(num
,next
);
852 /*********************************************************************
855 char * CDECL
_ecvt( double number
, int ndigits
, int *decpt
, int *sign
)
857 thread_data_t
*data
= msvcrt_get_thread_data();
860 if (!data
->efcvt_buffer
)
861 data
->efcvt_buffer
= MSVCRT_malloc( 80 ); /* ought to be enough */
863 snprintf(data
->efcvt_buffer
, 80, "%.*e", ndigits
/* FIXME wrong */, number
);
864 *sign
= (number
< 0);
865 dec
= strchr(data
->efcvt_buffer
, '.');
866 *decpt
= (dec
) ? dec
- data
->efcvt_buffer
: -1;
867 return data
->efcvt_buffer
;
870 /***********************************************************************
873 char * CDECL
_fcvt( double number
, int ndigits
, int *decpt
, int *sign
)
875 thread_data_t
*data
= msvcrt_get_thread_data();
876 int stop
, dec1
, dec2
;
877 char *ptr1
, *ptr2
, *first
;
878 char buf
[80]; /* ought to be enough */
880 if (!data
->efcvt_buffer
)
881 data
->efcvt_buffer
= MSVCRT_malloc( 80 ); /* ought to be enough */
889 snprintf(buf
, 80, "%.*f", ndigits
< 0 ? 0 : ndigits
, number
);
891 ptr2
= data
->efcvt_buffer
;
896 /* For numbers below the requested resolution, work out where
897 the decimal point will be rather than finding it in the string */
898 if (number
< 1.0 && number
> 0.0) {
899 dec2
= log10(number
+ 1e-10);
900 if (-dec2
<= ndigits
) dec2
= 0;
903 /* If requested digits is zero or less, we will need to truncate
904 * the returned string */
906 stop
= strlen(buf
) + ndigits
;
911 while (*ptr1
== '0') ptr1
++; /* Skip leading zeroes */
912 while (*ptr1
!= '\0' && *ptr1
!= '.') {
913 if (!first
) first
= ptr2
;
914 if ((ptr1
- buf
) < stop
) {
925 while (*ptr1
== '0') { /* Process leading zeroes */
930 while (*ptr1
!= '\0') {
931 if (!first
) first
= ptr2
;
938 /* We never found a non-zero digit, then our number is either
939 * smaller than the requested precision, or 0.0 */
944 first
= data
->efcvt_buffer
;
949 *decpt
= dec2
? dec2
: dec1
;
953 /***********************************************************************
956 * FIXME: uses both E and F.
958 char * CDECL
_gcvt( double number
, int ndigit
, char *buff
)
960 sprintf(buff
, "%.*E", ndigit
, number
);
964 #include <stdlib.h> /* div_t, ldiv_t */
966 /*********************************************************************
969 * [i386] Windows binary compatible - returns the struct in eax/edx.
972 unsigned __int64 CDECL
MSVCRT_div(int num
, int denom
)
974 div_t dt
= div(num
,denom
);
975 return ((unsigned __int64
)dt
.rem
<< 32) | (unsigned int)dt
.quot
;
978 /*********************************************************************
981 * [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility
983 MSVCRT_div_t CDECL
MSVCRT_div(int num
, int denom
)
985 div_t dt
= div(num
,denom
);
993 #endif /* ifdef __i386__ */
996 /*********************************************************************
999 * [i386] Windows binary compatible - returns the struct in eax/edx.
1002 unsigned __int64 CDECL
MSVCRT_ldiv(long num
, long denom
)
1004 ldiv_t ldt
= ldiv(num
,denom
);
1005 return ((unsigned __int64
)ldt
.rem
<< 32) | (unsigned long)ldt
.quot
;
1008 /*********************************************************************
1011 * [!i386] Non-x86 can't run win32 apps so we don't need binary compatibility
1013 MSVCRT_ldiv_t CDECL
MSVCRT_ldiv(long num
, long denom
)
1015 ldiv_t result
= ldiv(num
,denom
);
1018 ret
.quot
= result
.quot
;
1019 ret
.rem
= result
.rem
;
1023 #endif /* ifdef __i386__ */
1025 /***********************************************************************
1026 * _adj_fdiv_m16i (MSVCRT.@)
1029 * I _think_ this function is intended to work around the Pentium
1032 void __stdcall
_adj_fdiv_m16i( short arg
)
1034 TRACE("(): stub\n");
1037 /***********************************************************************
1038 * _adj_fdiv_m32 (MSVCRT.@)
1041 * I _think_ this function is intended to work around the Pentium
1044 void __stdcall
_adj_fdiv_m32( unsigned int arg
)
1046 TRACE("(): stub\n");
1049 /***********************************************************************
1050 * _adj_fdiv_m32i (MSVCRT.@)
1053 * I _think_ this function is intended to work around the Pentium
1056 void __stdcall
_adj_fdiv_m32i( int arg
)
1058 TRACE("(): stub\n");
1061 /***********************************************************************
1062 * _adj_fdiv_m64 (MSVCRT.@)
1065 * I _think_ this function is intended to work around the Pentium
1068 void __stdcall
_adj_fdiv_m64( unsigned __int64 arg
)
1070 TRACE("(): stub\n");
1073 /***********************************************************************
1074 * _adj_fdiv_r (MSVCRT.@)
1076 * This function is likely to have the wrong number of arguments.
1079 * I _think_ this function is intended to work around the Pentium
1082 void _adj_fdiv_r(void)
1084 TRACE("(): stub\n");
1087 /***********************************************************************
1088 * _adj_fdivr_m16i (MSVCRT.@)
1091 * I _think_ this function is intended to work around the Pentium
1094 void __stdcall
_adj_fdivr_m16i( short arg
)
1096 TRACE("(): stub\n");
1099 /***********************************************************************
1100 * _adj_fdivr_m32 (MSVCRT.@)
1103 * I _think_ this function is intended to work around the Pentium
1106 void __stdcall
_adj_fdivr_m32( unsigned int arg
)
1108 TRACE("(): stub\n");
1111 /***********************************************************************
1112 * _adj_fdivr_m32i (MSVCRT.@)
1115 * I _think_ this function is intended to work around the Pentium
1118 void __stdcall
_adj_fdivr_m32i( int arg
)
1120 TRACE("(): stub\n");
1123 /***********************************************************************
1124 * _adj_fdivr_m64 (MSVCRT.@)
1127 * I _think_ this function is intended to work around the Pentium
1130 void __stdcall
_adj_fdivr_m64( unsigned __int64 arg
)
1132 TRACE("(): stub\n");
1135 /***********************************************************************
1136 * _adj_fpatan (MSVCRT.@)
1138 * This function is likely to have the wrong number of arguments.
1141 * I _think_ this function is intended to work around the Pentium
1144 void _adj_fpatan(void)
1146 TRACE("(): stub\n");
1149 /***********************************************************************
1150 * _adj_fprem (MSVCRT.@)
1152 * This function is likely to have the wrong number of arguments.
1155 * I _think_ this function is intended to work around the Pentium
1158 void _adj_fprem(void)
1160 TRACE("(): stub\n");
1163 /***********************************************************************
1164 * _adj_fprem1 (MSVCRT.@)
1166 * This function is likely to have the wrong number of arguments.
1169 * I _think_ this function is intended to work around the Pentium
1172 void _adj_fprem1(void)
1174 TRACE("(): stub\n");
1177 /***********************************************************************
1178 * _adj_fptan (MSVCRT.@)
1180 * This function is likely to have the wrong number of arguments.
1183 * I _think_ this function is intended to work around the Pentium
1186 void _adj_fptan(void)
1188 TRACE("(): stub\n");
1191 /***********************************************************************
1192 * _adjust_fdiv (MSVCRT.@)
1194 * I _think_ this function should be a variable indicating whether
1195 * Pentium fdiv bug safe code should be used.
1197 void _adjust_fdiv(void)
1199 TRACE("(): stub\n");
1202 /***********************************************************************
1203 * _safe_fdiv (MSVCRT.@)
1205 * This function is likely to have the wrong number of arguments.
1208 * I _think_ this function is intended to work around the Pentium
1211 void _safe_fdiv(void)
1213 TRACE("(): stub\n");
1216 /***********************************************************************
1217 * _safe_fdivr (MSVCRT.@)
1219 * This function is likely to have the wrong number of arguments.
1222 * I _think_ this function is intended to work around the Pentium
1225 void _safe_fdivr(void)
1227 TRACE("(): stub\n");
1230 /***********************************************************************
1231 * _safe_fprem (MSVCRT.@)
1233 * This function is likely to have the wrong number of arguments.
1236 * I _think_ this function is intended to work around the Pentium
1239 void _safe_fprem(void)
1241 TRACE("(): stub\n");
1244 /***********************************************************************
1245 * _safe_fprem1 (MSVCRT.@)
1248 * This function is likely to have the wrong number of arguments.
1251 * I _think_ this function is intended to work around the Pentium
1254 void _safe_fprem1(void)
1256 TRACE("(): stub\n");