variables.mdl 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. a = 1
  2. b = "foo"
  3. c = [ 1, 2, 3, 4, 5]
  4. d = a
  5. e = d + 123
  6. d = b
  7. f = d & "bar" & "chicken"
  8. d = c
  9. g = INPUT_FILE
  10. e1 = PI
  11. e2 = (e1)
  12. e3 = EXP(e2)
  13. e4 = LOG(e3)
  14. e5 = LOG10(e3)
  15. e6 = MAX(e4, e5)
  16. e7 = MIN(e4, e5)
  17. e8 = ROUND_OFF(3, e6)
  18. e9 = ROUND_OFF(3, e7)
  19. e10 = FLOOR(e8)
  20. e11 = CEIL(e9)
  21. e12 = SIN(e10)
  22. e13 = COS(e10)
  23. e14 = e12*e12 + e13*e13
  24. e15 = TAN(e10)
  25. e16 = ASIN(0.5)
  26. e17 = ACOS(0.5)
  27. e18 = ATAN(0.5)
  28. e19 = SQRT(2.0)
  29. e20 = ABS(-1.0)
  30. e21 = ABS(1.0)
  31. e22 = ABS(0.0)
  32. e23 = MOD(2.1, 1.7)
  33. e24 =(RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  34. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  35. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  36. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  37. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  38. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  39. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  40. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  41. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  42. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  43. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  44. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  45. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  46. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  47. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM
  48. + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM + RAND_UNIFORM) / 64
  49. e25 =(RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  50. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  51. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  52. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  53. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  54. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  55. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  56. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  57. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  58. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  59. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  60. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  61. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  62. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  63. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN
  64. + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN + RAND_GAUSSIAN) / 64
  65. e26 = SEED
  66. e27 = STRING_TO_NUM("1")
  67. e28 = STRING_TO_NUM("1.2")
  68. e29 = STRING_TO_NUM("-1.2")
  69. e30 = STRING_TO_NUM("-1.4e-4")
  70. e31 = (e27 + e28) * (e28 - e27)
  71. e32 = +4
  72. e33 = -5
  73. e34 = 2.1 ^ 3
  74. s1 = "3.14159265358979"
  75. s2 = "3.14159265358979"
  76. s3 = "23.1406926327793"
  77. s4 = "3.14159265358979"
  78. s5 = "1.36437635384184"
  79. s6 = "3.14159265358979"
  80. s7 = "1.36437635384184"
  81. s8 = "3.14"
  82. s9 = "1.36"
  83. s10 = "3"
  84. s11 = "2"
  85. s12 = "0.141120008059867"
  86. s13 = "-0.989992496600445"
  87. s14 = "1"
  88. s15 = "-0.142546543074278"
  89. s16 = "0.523598775598299"
  90. s17 = "1.0471975511966"
  91. s18 = "0.463647609000806"
  92. s19 = "1.4142135623731"
  93. s20 = "1"
  94. s21 = "1"
  95. s22 = "0"
  96. s23 = "0.4"
  97. s24 = "0.5/.03608439182435161028"
  98. s25 = "0.0/0.125"
  99. sprintf(s26, "%g", SEED)
  100. s27 = "1"
  101. s28 = "1.2"
  102. s29 = "-1.2"
  103. s30 = "-0.00014"
  104. s31 = "0.44"
  105. s32 = "4"
  106. s33 = "-5"
  107. s34 = "9.261"
  108. testfile = fopen(basename & "-expressions.dat", "w")
  109. nexpr = 1
  110. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e1, s1) nexpr = nexpr + 1
  111. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e2, s2) nexpr = nexpr + 1
  112. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e3, s3) nexpr = nexpr + 1
  113. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e4, s4) nexpr = nexpr + 1
  114. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e5, s5) nexpr = nexpr + 1
  115. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e6, s6) nexpr = nexpr + 1
  116. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e7, s7) nexpr = nexpr + 1
  117. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e8, s8) nexpr = nexpr + 1
  118. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e9, s9) nexpr = nexpr + 1
  119. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e10, s10) nexpr = nexpr + 1
  120. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e11, s11) nexpr = nexpr + 1
  121. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e12, s12) nexpr = nexpr + 1
  122. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e13, s13) nexpr = nexpr + 1
  123. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e14, s14) nexpr = nexpr + 1
  124. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e15, s15) nexpr = nexpr + 1
  125. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e16, s16) nexpr = nexpr + 1
  126. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e17, s17) nexpr = nexpr + 1
  127. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e18, s18) nexpr = nexpr + 1
  128. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e19, s19) nexpr = nexpr + 1
  129. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e20, s20) nexpr = nexpr + 1
  130. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e21, s21) nexpr = nexpr + 1
  131. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e22, s22) nexpr = nexpr + 1
  132. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e23, s23) nexpr = nexpr + 1
  133. fprintf(testfile, "%03g: %.15g ~= %s\n", nexpr, e24, s24) nexpr = nexpr + 1
  134. fprintf(testfile, "%03g: %.15g ~= %s\n", nexpr, e25, s25) nexpr = nexpr + 1
  135. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e26, s26) nexpr = nexpr + 1
  136. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e27, s27) nexpr = nexpr + 1
  137. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e28, s28) nexpr = nexpr + 1
  138. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e29, s29) nexpr = nexpr + 1
  139. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e30, s30) nexpr = nexpr + 1
  140. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e31, s31) nexpr = nexpr + 1
  141. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e32, s32) nexpr = nexpr + 1
  142. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e33, s33) nexpr = nexpr + 1
  143. fprintf(testfile, "%03g: %.15g == %s\n", nexpr, e34, s34) nexpr = nexpr + 1
  144. fclose(testfile)