The 64-bit version of FlexSim should not have a problem with the numbers that you are trying to use. 6.8e17 should still have enough space in a double for decimal places.
I ran some tests using the script console and the following code:
double returnval = 6.8 * pow(10,17);
double maxvalue = 10000;
double temp;
for (int i1 = 1; i1 <= 1000000000; i1++) {
returnval = min(returnval, uniform(0, maxvalue));
}
return returnval;
With maxvalue set to 10,000 the result was 0.8351.
With maxvalue set to 1,000,000 the result was 1.1325.
Withmax value set to 1,000,000,000 the result was 734896719.4557.
With maxvalue set to 6.8*pow(10,17) the result was 228457643985748290.0000.
Based on the above results I tried the following in the script console:
double minval = 6.8 * pow(10,17);
double maxval = 0;
double temp;
for (int i1 = 1; i1 <= 10000000; i1++) {
temp = uniform(0, 6.8) * pow(10, duniform(1, 17));
maxval = max(maxval, temp);
minval = min(minval, temp);
}
pr(); pt("Min: "); pf(minval);
pr(); pt("Max: "); pf(maxval);
With the results:
Min: 0.000004
Max: 679999716281890940.000000
So, by changing the code a little I think you can get results closer to what you are looking for.
I hope this helps,
Brandon
P.S. That first block of code will take a while to run!
@anthony.johnson @phil.bobo
img src="https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgbblack-small_forum.png" >
Brandon Peterson
Principal Technology Consultant
>