Index: cpp/common/nonstd_math.cpp
===================================================================
--- cpp/common/nonstd_math.cpp	(revision 1288)
+++ cpp/common/nonstd_math.cpp	(revision 1298)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2023  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -8,4 +8,17 @@
 #include <sstream>
 #include <algorithm> // std::min()
+#include <common/log.h>
+
+
+unsigned int rndUint(int limit_exclusive)
+{
+	if (limit_exclusive < 0) 
+	{ 
+		logPrintf("", "rndUint", LOG_ERROR, "rndUint(negative: %d)", limit_exclusive);
+		return 0;
+	}
+	else return rndUint((unsigned int)limit_exclusive);
+}
+
 
 RandomGenerator &rndGetInstance()
@@ -125,4 +138,9 @@
 #include <fenv.h>
 
+#ifdef __CYGWIN__ //since my cygwin update in 2024 (g++ (GCC) 11.4.0), these two are no longer found:
+ #define feenableexcept(x)
+ #define fedisableexcept(x)
+#endif
+
 namespace fpExcept
 { 
@@ -203,2 +221,3 @@
 
 #endif
+
Index: cpp/common/nonstd_math.h
===================================================================
--- cpp/common/nonstd_math.h	(revision 1288)
+++ cpp/common/nonstd_math.h	(revision 1298)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -9,9 +9,9 @@
 #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 wcze�niej <cmath> bez _USE_MATH_DEFINES, a <cmath> includuje <math.h> (ale tylko raz bo ma "include guards" jak kazdy .h)
+ #include <math.h> //in vc2008, <cmath> worked here, but no longer in vc2010 because "something" (some other .h from stl?) earlier includes <cmath> without _USE_MATH_DEFINES, and <cmath> includes <math.h> (just once because it has "include guards" like any other .h)
  #include <float.h>
  //#define isnan(x) _isnan(x) //since 2014 we use std::isnan()
  #define finite(x) _finite(x)
-#else //m.in. __BORLANDC__
+#else //e.g. __BORLANDC__
  #include <math.h>
 #endif
@@ -25,4 +25,6 @@
 inline double rndDouble(double limit_exclusive) { return rndGetInstance().getDouble() * limit_exclusive; }
 inline unsigned int rndUint(unsigned int limit_exclusive) { return (unsigned int)(rndGetInstance().getDouble() * limit_exclusive); } //returns random from 0..limit_exclusive-1
+inline unsigned int rndUint(size_t limit_exclusive) {return rndUint((unsigned int)limit_exclusive);} //just an overload with size_t argument
+unsigned int rndUint(int limit_exclusive); //just an overload with int argument
 inline void rndSetSeed(unsigned int seed) { rndGetInstance().setSeed(seed); }
 inline unsigned int rndRandomizeSeed() { return rndGetInstance().randomize(); }
Index: cpp/frams/genetics/f4/f4_oper.cpp
===================================================================
--- cpp/frams/genetics/f4/f4_oper.cpp	(revision 1288)
+++ cpp/frams/genetics/f4/f4_oper.cpp	(revision 1298)
@@ -253,5 +253,5 @@
 				return GENOPER_OPFAIL;
 
-			node_mutated = candidate_nodes[rndUint((unsigned int)candidate_nodes.size())];
+			node_mutated = candidate_nodes[rndUint(candidate_nodes.size())];
 			f4_Node *node_mutated_parent = node_mutated->parent;
 
Index: cpp/frams/genetics/fB/fB_oper.cpp
===================================================================
--- cpp/frams/genetics/fB/fB_oper.cpp	(revision 1288)
+++ cpp/frams/genetics/fB/fB_oper.cpp	(revision 1298)
@@ -252,5 +252,5 @@
 	{
 		std::list<SString> tokenized = tokenizeSequence(line);
-		int rndid = rndUint((int)tokenized.size()); // select random letter from genotype
+		int rndid = rndUint(tokenized.size()); // select random letter from genotype
 		// increment/decrement character - when overflow happens, this method
 		// uses the "reflect" approach
@@ -291,5 +291,5 @@
 		std::list<SString> tokenized = tokenizeSequence(line);
 		std::list<SString>::iterator it = tokenized.begin();
-		int rndid = rndUint((int)tokenized.size()); // select random insertion point
+		int rndid = rndUint(tokenized.size()); // select random insertion point
 		std::advance(it, rndid);
 		NeuroClass *cls = getRandomNeuroClass(Model::SHAPETYPE_BALL_AND_STICK);
@@ -312,5 +312,5 @@
 		chg = 1.0 / line.length();
 		std::list<SString> tokenized = tokenizeSequence(line);
-		int rndid = rndUint((int)tokenized.size()); // select random insertion point
+		int rndid = rndUint(tokenized.size()); // select random insertion point
 		std::list<SString>::iterator it = tokenized.begin();
 		std::advance(it, rndid);
@@ -326,5 +326,5 @@
 		std::list<SString> tokenized = tokenizeSequence(line);
 		std::list<SString>::iterator it = tokenized.begin();
-		int rndid = rndUint((int)tokenized.size()); // select random deletion point
+		int rndid = rndUint(tokenized.size()); // select random deletion point
 		std::advance(it, rndid);
 		tokenized.erase(it);
@@ -348,5 +348,5 @@
 		for (int i = 0; i < 4; i++)
 		{
-			cuts[i] = rndUint((int)tokenized.size());
+			cuts[i] = rndUint(tokenized.size());
 		}
 		std::sort(cuts.begin(), cuts.end());
Index: cpp/frams/genetics/fF/fF_oper.cpp
===================================================================
--- cpp/frams/genetics/fF/fF_oper.cpp	(revision 1288)
+++ cpp/frams/genetics/fF/fF_oper.cpp	(revision 1298)
@@ -49,5 +49,5 @@
 	par.load(gene);
 	static const int propsToMutate[] = fF_PROPS_TO_MUTATE;
-	int which = rndUint((unsigned int)std::size(propsToMutate));
+	int which = rndUint(std::size(propsToMutate));
 	bool mutated_ok = GenoOperators::mutatePropertyNaive(par.param, propsToMutate[which]);
 	if (mutated_ok)
Index: cpp/frams/genetics/fL/fL_oper.cpp
===================================================================
--- cpp/frams/genetics/fL/fL_oper.cpp	(revision 1288)
+++ cpp/frams/genetics/fL/fL_oper.cpp	(revision 1298)
@@ -181,5 +181,5 @@
 	else
 	{
-		int rid = rndUint((unsigned int)creature->rules.size());
+		int rid = rndUint(creature->rules.size());
 		list = &creature->rules[rid]->objsucc;
 		numparams = creature->rules[rid]->objpred->npar;
@@ -313,5 +313,5 @@
 		if (creature->rules.size() > 0)
 		{
-			int ruleid = rndUint((unsigned int)creature->rules.size());
+			int ruleid = rndUint(creature->rules.size());
 			if (!creature->rules[ruleid]->condeval)
 			{
@@ -350,5 +350,5 @@
 		if (wordswithnorules.size() > 0)
 		{
-			int predid = rndUint((unsigned int)wordswithnorules.size());
+			int predid = rndUint(wordswithnorules.size());
 			fL_Rule *newrule = new fL_Rule(0, 0);
 			fL_Word *pred = new fL_Word();
@@ -362,5 +362,5 @@
 		else if (creature->rules.size() > 0)
 		{
-			int ruleid = rndUint((unsigned int)creature->rules.size());
+			int ruleid = rndUint(creature->rules.size());
 			fL_Rule *newrule = new fL_Rule(0, 0);
 			fL_Word *pred = new fL_Word();
@@ -465,5 +465,5 @@
 		else
 		{
-			int rndid = rndUint((unsigned int)list->size());
+			int rndid = rndUint(list->size());
 			std::list<fL_Word *>::iterator it = list->begin();
 			std::advance(it, rndid);
@@ -492,5 +492,5 @@
 		int tmp = 0;
 		std::list<fL_Word *> *list = selectRandomSequence(creature, numpars, tmp);
-		int rndid = rndUint((unsigned int)list->size());
+		int rndid = rndUint(list->size());
 		std::list<fL_Word *>::iterator it = list->begin();
 		std::advance(it, rndid);
@@ -541,5 +541,5 @@
 		int tmp = 0;
 		std::list<fL_Word *> *list = selectRandomSequence(creature, numpars, tmp);
-		int rndid = rndUint((unsigned int)list->size());
+		int rndid = rndUint(list->size());
 		std::list<fL_Word *>::iterator selectedword = list->begin();
 		std::advance(selectedword, rndid);
@@ -555,5 +555,5 @@
 			int numpars = 0;
 			std::list<fL_Word *> *list = selectRandomSequence(creature, numpars, tmp);
-			int rndid = rndUint((unsigned int)list->size());
+			int rndid = rndUint(list->size());
 			std::list<fL_Word *>::iterator it = list->begin();
 			std::advance(it, rndid);
@@ -587,5 +587,5 @@
 				if (available.size() > 0)
 				{
-					int newnameid = rndUint((unsigned int)available.size());
+					int newnameid = rndUint(available.size());
 					(*selectedword)->name = available[newnameid]->name;
 				}
@@ -762,5 +762,5 @@
 		for (int i = 0; i < numselrules; i++)
 		{
-			int rulid = rndUint((unsigned int)from->rules.size());
+			int rulid = rndUint(from->rules.size());
 			fL_Rule *rul = from->rules[rulid];
 			fL_Rule *newrule = new fL_Rule(0, 0);
