source: sasview/sansmodels/src/sans/models/libigor/winFuncs.h @ ef70686

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since ef70686 was b23b722, checked in by Mathieu Doucet <doucetm@…>, 13 years ago

Re #5 fixing samsmodels compilation on MSVC

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[07b5556d]1#if !defined(WINFUNCS_H)
2#define WINFUNCS_H
[6e93a02]3/* winFuncs.h
4   Definitions for missing math lib functions
5   Andrew Jackson, October 2007
6   */
7
[b23b722]8#ifdef __cplusplus
9extern "C" {
10#endif
11
[6e93a02]12double fmax(double x, double y);
13//long double fmaxl (long double x, long double y);
14//float fmaxf (float x, float y);
15
16double fmin(double x, double y);
17
18double trunc(double x);
19//long double truncl(long double x);
20//float truncf(float x);
21
22double erf(double x);
23//long double erfl(long double x);
24//float erff (float x);
25//double erfc(double x);
26//long double erfcl(long double x);
[6a2c931]27//float erfcf(float x;
28
[b23b722]29#ifdef __cplusplus
30}
31#endif
[6a2c931]32
33// Define INFINITY and NAN
34typedef union { unsigned char __c[4]; float __f; } __huge_valf_t;
35
36# if __BYTE_ORDER == __BIG_ENDIAN
37#  define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 }
38# endif
39# if __BYTE_ORDER == __LITTLE_ENDIAN
40#  define __HUGE_VALF_bytes { 0, 0, 0x80, 0x7f }
41# endif
42
43static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
44# define INFINITY  (__huge_valf.__f)
45
46
47# if __BYTE_ORDER == __BIG_ENDIAN
48#  define __nan_bytes   { 0x7f, 0xc0, 0, 0 }
49# endif
50# if __BYTE_ORDER == __LITTLE_ENDIAN
51#  define __nan_bytes   { 0, 0, 0xc0, 0x7f }
52# endif
53
54static union { unsigned char __c[4]; float __d; } __nan_union;
55# define NAN  (__nan_union.__d)
56
[07b5556d]57#endif
Note: See TracBrowser for help on using the repository browser.