gdiplus: In GdipImageSelectActiveFrame rely on codec->select_func() to fail.
[wine.git] / dlls / ntdll / math.c
blob73a5bb8cd33ebfd7d6ff8a06889da4f416e11226
1 /*
2 * Math functions
4 * Copyright 2021 Alexandre Julliard
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
21 #include <math.h>
22 #include <float.h>
24 #include "ntstatus.h"
25 #define WIN32_NO_STATUS
26 #include "ntdll_misc.h"
28 double math_error( int type, const char *name, double arg1, double arg2, double retval )
30 return retval;
33 /*********************************************************************
34 * abs (NTDLL.@)
36 int CDECL abs( int i )
38 return i >= 0 ? i : -i;
41 #if (defined(__GNUC__) || defined(__clang__)) && defined(__i386__)
43 #define FPU_DOUBLE(var) double var; \
44 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var) : )
45 #define FPU_DOUBLES(var1,var2) double var1,var2; \
46 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var2) : ); \
47 __asm__ __volatile__( "fstpl %0;fwait" : "=m" (var1) : )
49 /*********************************************************************
50 * _CIcos (NTDLL.@)
52 double CDECL _CIcos(void)
54 FPU_DOUBLE(x);
55 return cos(x);
58 /*********************************************************************
59 * _CIlog (NTDLL.@)
61 double CDECL _CIlog(void)
63 FPU_DOUBLE(x);
64 return log(x);
67 /*********************************************************************
68 * _CIpow (NTDLL.@)
70 double CDECL _CIpow(void)
72 FPU_DOUBLES(x,y);
73 return pow(x,y);
76 /*********************************************************************
77 * _CIsin (NTDLL.@)
79 double CDECL _CIsin(void)
81 FPU_DOUBLE(x);
82 return sin(x);
85 /*********************************************************************
86 * _CIsqrt (NTDLL.@)
88 double CDECL _CIsqrt(void)
90 FPU_DOUBLE(x);
91 return sqrt(x);
94 /*********************************************************************
95 * _ftol (NTDLL.@)
97 LONGLONG CDECL _ftol(void)
99 FPU_DOUBLE(x);
100 return (LONGLONG)x;
103 #endif /* (defined(__GNUC__) || defined(__clang__)) && defined(__i386__) */