-#include <stdarg.h>
-#include <windef.h>
-#include <winbase.h>
-#include <winuser.h>
-#include <wingdi.h>
-#include <winreg.h>
+#ifndef __CALC_H__
+#define __CALC_H__
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
#include <tchar.h>
-//#include <stdio.h>
-//#include <string.h>
+#include <commctrl.h>
+#include <shellapi.h>
+
+#include <stdio.h>
+#include <string.h>
#include <math.h>
#include <float.h>
#include <malloc.h>
#define WM_HANDLE_FROM (WM_APP+6)
#define WM_HANDLE_TO (WM_APP+7)
+/* GNU MULTI-PRECISION LIBRARY support */
#ifdef ENABLE_MULTI_PRECISION
-#include <mpfr.h>
+#include "mpfr.h"
#ifndef MPFR_DEFAULT_RND
#define MPFR_DEFAULT_RND mpfr_get_default_rounding_mode ()
#define IDC_STATIC ((DWORD)-1)
#endif
-#define CALC_VERSION TEXT("1.11")
+#define CALC_VERSION _T("1.12")
#define MAX_CALC_SIZE 256
extern calc_t calc;
-//
-#define CALC_E 2.7182818284590452354
-
-#define CALC_PI_2 1.57079632679489661923
-#define CALC_PI 3.14159265358979323846
-#define CALC_3_PI_2 4.71238898038468985769
+/* IEEE constants */
+#define CALC_E 2.718281828459045235360
+#define CALC_PI_2 1.570796326794896619231
+#define CALC_PI 3.141592653589793238462
+#define CALC_3_PI_2 4.712388980384689857694
#define CALC_2_PI 6.283185307179586476925
#define MODIFIER_INV 0x01
#define NO_CHAIN 0x04
void apply_int_mask(calc_number_t *a);
-#ifdef ENABLE_MULTI_PRECISION
-void validate_rad2angle(calc_number_t *c);
-void validate_angle2rad(calc_number_t *c);
-#else
+#ifndef ENABLE_MULTI_PRECISION
__int64 logic_dbl2int(calc_number_t *a);
double logic_int2dbl(calc_number_t *a);
-double validate_rad2angle(double a);
-double validate_angle2rad(calc_number_t *c);
#endif
void rpn_sin(calc_number_t *c);
void rpn_cos(calc_number_t *c);
void rpn_ln(calc_number_t *c);
void rpn_log(calc_number_t *c);
void rpn_ave(calc_number_t *c);
+void rpn_ave2(calc_number_t *c);
void rpn_sum(calc_number_t *c);
+void rpn_sum2(calc_number_t *c);
void rpn_s(calc_number_t *c);
void rpn_s_m1(calc_number_t *c);
void rpn_dms2dec(calc_number_t *c);
void ConvExecute(HWND hWnd);
void ConvAdjust(HWND hWnd, int n_cat);
void ConvInit(HWND hWnd);
+
+#endif /* __CALC_H__ */