Index: /cpp/common/nonstd_math.cpp
===================================================================
--- /cpp/common/nonstd_math.cpp	(revision 1274)
+++ /cpp/common/nonstd_math.cpp	(revision 1275)
@@ -88,6 +88,13 @@
 }
 
-
-
+namespace fpExcept
+{ //shared for all platform, using crossplatform constants, can be defined in build_config (but also conditionally changed from the code)
+int wanted_exceptions =
+#ifdef WANTED_FP_EXCEPTIONS
+	WANTED_FP_EXCEPTIONS;
+#else
+	FPEX_DIV0; //default when 'WANTED_FP_EXCEPTIONS' is not defined (add more?)
+#endif
+}
 
 // Idea: enable selected floating point exceptions when the app starts and disable them temporarily when dividing values in ExtValue, so that we can directly handle problematic cases there.
@@ -96,48 +103,39 @@
 #ifdef IPHONE
 //TODO! -> ? http://stackoverflow.com/questions/12762418/how-to-enable-sigfpe-signal-on-division-by-zero-in-ios-app
-void fpExceptInit()
-{}
-
-void fpExceptEnable()
-{}
-
-void fpExceptDisable()
-{}
+namespace fpExcept
+{ 
+	void init() {}
+	void enable() {}
+	void disable() {}
+}
 #endif
 
 #ifdef MACOS
-//TODO...?
-
-void fpExceptInit()
-{}
-
-void fpExceptEnable()
-{}
-
-void fpExceptDisable()
-{}
+//TODO...? (even less reasons to omit this in macos :-P)
+namespace fpExcept
+{ 
+	void init() {}
+	void enable() {}
+	void disable() {}
+}
 #endif
 
 
 #if defined LINUX || defined TIZEN || defined __ANDROID__
-
 #include <fenv.h>
 
-static constexpr int WANTED_FP_EXCEPTIONS = FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW;
-
-void fpExceptInit()
-{}
-
-void fpExceptEnable()
-{
-	feclearexcept(WANTED_FP_EXCEPTIONS);
-	feenableexcept(WANTED_FP_EXCEPTIONS);
-}
-
-void fpExceptDisable()
-{
-	fedisableexcept(WANTED_FP_EXCEPTIONS);
-}
-
+namespace fpExcept
+{ 
+	void init() {}
+	void enable()
+	{
+		feclearexcept(wanted_exceptions);
+		feenableexcept(wanted_exceptions);
+	}
+	void disable()
+	{
+		fedisableexcept(wanted_exceptions);
+	}
+};
 #endif
 
@@ -146,4 +144,6 @@
 #if defined(__BORLANDC__) || defined(_MSC_VER)
 
+namespace fpExcept
+{ 
 // in Borland, there was once a problem like this:
 // http://qc.embarcadero.com/wc/qcmain.aspx?d=5128
@@ -177,13 +177,12 @@
 unsigned int fp_control_word_muted;
 
-
-void fpExceptInit()
+void init()
 {
 	_controlfp_s(&fp_control_word_std, 0, 0); //in Visual C++, the default value is exactly the masks listed below, and we have to turn them off to enable exceptions
 	// Make the new fp env same as the old one, except for the changes we're going to make
-	fp_control_word_muted = fp_control_word_std & ~(EM_INVALID | /*EM_DENORMAL |*/ EM_ZERODIVIDE | EM_OVERFLOW /* | EM_UNDERFLOW | EM_INEXACT */); //commented out exceptions that occur during proper operation
-}
-
-void fpExceptEnable()
+	fp_control_word_muted = fp_control_word_std & ~wanted_exceptions;
+}
+
+void enable()
 {
 	//_fpreset(); //not needed since we just _clearfp()... mentioned in https://stackoverflow.com/questions/4282217/visual-c-weird-behavior-after-enabling-floating-point-exceptions-compiler-b
@@ -193,5 +192,5 @@
 }
 
-void fpExceptDisable()
+void disable()
 {
 	//_fpreset(); //not needed since we just _clearfp()... mentioned in https://stackoverflow.com/questions/4282217/visual-c-weird-behavior-after-enabling-floating-point-exceptions-compiler-b
@@ -200,3 +199,6 @@
 	_controlfp_s(&was, fp_control_word_std, _MCW_EM);
 }
-#endif
+	
+};
+
+#endif
Index: /cpp/common/nonstd_math.h
===================================================================
--- /cpp/common/nonstd_math.h	(revision 1274)
+++ /cpp/common/nonstd_math.h	(revision 1275)
@@ -9,5 +9,5 @@
 #ifdef _MSC_VER
  #define _USE_MATH_DEFINES //after this is defined, the next #include <math.h> or <cmath> will define M_PI etc.
- #include <math.h> //w vc2008 dzia³a³o tu <cmath>, ale w vc2010 juz nie bo "co" (jaki inny .h stl'a?) includuje wczeniej <cmath> bez _USE_MATH_DEFINES, a <cmath> includuje <math.h> (ale tylko raz bo ma "include guards" jak kazdy .h)
+ #include <math.h> //w vc2008 dzia�a�o tu <cmath>, ale w vc2010 juz nie bo "co�" (jaki� inny .h stl'a?) includuje wcze�niej <cmath> bez _USE_MATH_DEFINES, a <cmath> includuje <math.h> (ale tylko raz bo ma "include guards" jak kazdy .h)
  #include <float.h>
  //#define isnan(x) _isnan(x) //since 2014 we use std::isnan()
@@ -69,5 +69,5 @@
 
 #if defined SHP
- //#define __assert_func(a,b,c,d) 0 //Currently, we are sorry to inform you that assert() is not yet supported. We have considered your request for internal discussion. Na szczêcie jest w³asna (byle by by³a, bo i tak zak³adamy ze assert ktore przeciez dziala tylko w trybie debug nie jest potrzebne na bada) implementacja w "bada-assert.cpp"
+ //#define __assert_func(a,b,c,d) 0 //Currently, we are sorry to inform you that assert() is not yet supported. We have considered your request for internal discussion. Na szcz�cie jest w�asna (byle by by�a, bo i tak zak�adamy ze assert ktore przeciez dziala tylko w trybie debug nie jest potrzebne na bada) implementacja w "bada-assert.cpp"
  #define isnan(x) false //isnan() sie nie linkuje
  #define finite(x) true //j.w.
@@ -79,8 +79,33 @@
 #endif
 
+#if defined LINUX || defined TIZEN || defined __ANDROID__
+#include <fenv.h>
+#endif
+
+namespace fpExcept
+{
 //handling floating point exceptions
-void fpExceptInit(); //call once, before ...Enable/Disable
-void fpExceptEnable();
-void fpExceptDisable();
+#if defined LINUX || defined TIZEN || defined __ANDROID__
+	//fenv.h values
+	static constexpr unsigned int FPEX_DIV0 = FE_DIVBYZERO;
+	static constexpr unsigned int FPEX_INVALID = FE_INVALID;
+	static constexpr unsigned int FPEX_OVERFLOW = FE_OVERFLOW;
+#elif defined IPHONE
+	// (not implemented but these constants are still needed)
+	static constexpr unsigned int FPEX_DIV0 = 0;
+	static constexpr unsigned int FPEX_INVALID = 0;
+	static constexpr unsigned int FPEX_OVERFLOW = 0;
+#else
+	//_control87() values
+	static constexpr unsigned int FPEX_DIV0 = EM_ZERODIVIDE;
+	static constexpr unsigned int FPEX_INVALID = EM_INVALID;
+	static constexpr unsigned int FPEX_OVERFLOW = EM_OVERFLOW;
+#endif
+	extern int wanted_exceptions;
+	
+	void init(); //call once, before ...Enable/Disable
+	void enable();
+	void disable();
+};
 
 // std::lerp can be used since C++20 (and has some guaranteed properties probably better than this basic formula) but apparently it is not a template
Index: /cpp/frams/util/extvalue.cpp
===================================================================
--- /cpp/frams/util/extvalue.cpp	(revision 1274)
+++ /cpp/frams/util/extvalue.cpp	(revision 1275)
@@ -703,5 +703,5 @@
 	else
 	{
-		fpExceptDisable();
+		fpExcept::disable();
 		double tmp = getDouble() / a;
 		if (!std::isfinite(tmp))
@@ -714,5 +714,5 @@
 		//if (isnan(ddata())) //http://www.digitalmars.com/d/archives/c++/Traping_divide_by_zero_5728.html
 		//	  { logPrintf("ExtValue","divide",LOG_ERROR,"not-a-number",(const char*)getString()); setInvalid(); }
-		fpExceptEnable();
+		fpExcept::enable();
 	}
 }
