Changeset 14229
- Timestamp:
- Nov 29, 2019 1:11:12 PM (2 weeks ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG.txt
r14223 r14229 1 1 ================= Unreleased ================== 2 ; Fixed ; Minor ; Compiler ; #5881 3 Fixed bug where constant evaluation of external functions could result 4 in loss of precision when returning values smaller than 1. 5 2 6 ; Fixed; Minor ; PyModelica; #5819 3 7 Fixed bug with incorrect exception being raised when -
trunk/Python/src/tests_jmodelica/files/Modelica/ExtFunctionTests.mo
r13908 r14229 407 407 end fRealScalar; 408 408 409 function fRealScalarSmall 410 input Real x_in; 411 output Real x_out; 412 external "C" annotation( 413 Library="externalFunctionsC", 414 Include="#include \"externalFunctionsC.h\""); 415 end fRealScalarSmall; 416 409 417 function fRealArray 410 418 input Real[2] x_in; … … 424 432 425 433 constant Real xScalar = fRealScalar(3); 434 constant Real xScalarSmall = fRealScalarSmall(1.234546789012345); 426 435 constant Real[2] xArray = fRealArray({4,5}); 427 436 constant Real[2] xArrayUnknown = fRealArrayUnknown({6,7}); -
trunk/Python/src/tests_jmodelica/files/Modelica/Resources/Include/externalFunctionsC.h
r9447 r14229 5 5 6 6 double fRealScalar(double in); 7 double fRealScalarSmall(double in); 7 8 int fIntegerScalar(int in); 8 9 int fEnumScalar(int in); -
trunk/Python/src/tests_jmodelica/files/Modelica/Resources/src/externalFunctionsC.c
r11746 r14229 9 9 return in*3.14; 10 10 } 11 12 13 double fRealScalarSmall(double in) 14 { 15 return in / 1.0e6; 16 } 17 11 18 12 19 void fRealArray(double* in, size_t in_d1, double* out, size_t out_d1) -
trunk/Python/src/tests_jmodelica/general/test_extfunctions.py
r14202 r14229 599 599 res = model.simulate() 600 600 nose.tools.assert_equals(res.final('xScalar'), 3*3.14) 601 nose.tools.assert_equals(res.final('xScalarSmall'), 1.234546789012345 / 1e6) 601 602 nose.tools.assert_equals(res.final('xArray[2]'), 4) 602 603 nose.tools.assert_equals(res.final('xArrayUnknown[2]'), 6) … … 769 770 for j in range(1,4): 770 771 x = 'out[{0},{1}]'.format(i,j) 771 nose.tools.assert_ almost_equals(resSim.final(x), resConst.final(x), places=13)772 nose.tools.assert_equals(resSim.final(x), resConst.final(x)) 772 773 nose.tools.assert_equals(resSim.final('a'), resConst.final('a')) 773 774 nose.tools.assert_equals(resSim.final('b'), resConst.final('b')) -
trunk/RuntimeLibrary/src/evaluator/jmi_evaluator_util.h
r13602 r14229 63 63 64 64 /* Format specifier when printing jmi_real_t */ 65 #define JMCEVAL_realFormat "%.1 6f"65 #define JMCEVAL_realFormat "%.17e" 66 66 67 67 /* Parses ND dimensions into dimension buffer d*/
Note: See TracChangeset
for help on using the changeset viewer.