Posted to tcl by dburns at Fri Aug 24 19:18:22 GMT 2012view raw

  1. This script gives different results (using the same three tclkit interpreters) depending on the underlying hardware architecture (windows XP - 32bit versus windows 7 - 64bit):
  2.  
  3. # Script to check "format" problem
  4. puts stdout "'format' test script"
  5. #
  6. puts stdout "tcl_patchLevel = $tcl_patchLevel"
  7. parray tcl_platform
  8. #
  9. puts stdout "\nSetting x = \"[set x "-0.000"]\""
  10. puts stdout "Formatting x to %9.3f: \"[format %9.3f $x]\"\n"
  11.  
  12. On 32-bit hardware, the "-" is stripped by format.
  13. On 64-bit hardware, the "-" is not stripped.
  14.  
  15. The 32-bit results:
  16. 8.6b
  17.  
  18. (testit) 1 % source testit
  19. 'format' test script
  20. tcl_patchLevel = 8.6b1.2
  21. tcl_platform(byteOrder) = littleEndian
  22. tcl_platform(machine) = intel
  23. tcl_platform(os) = Windows NT
  24. tcl_platform(osVersion) = 5.1
  25. tcl_platform(pathSeparator) = ;
  26. tcl_platform(platform) = windows
  27. tcl_platform(pointerSize) = 4
  28. tcl_platform(threaded) = 1
  29. tcl_platform(user) = IIEUSER
  30. tcl_platform(wordSize) = 4
  31.  
  32. Setting x = "-0.000"
  33. Formatting x to %9.3f: " 0.000"
  34.  
  35. (testit) 2 %
  36.  
  37. 8510
  38.  
  39. (testit) 1 % source testit
  40. 'format' test script
  41. tcl_patchLevel = 8.5.10
  42. tcl_platform(byteOrder) = littleEndian
  43. tcl_platform(machine) = intel
  44. tcl_platform(os) = Windows NT
  45. tcl_platform(osVersion) = 5.1
  46. tcl_platform(platform) = windows
  47. tcl_platform(pointerSize) = 4
  48. tcl_platform(threaded) = 1
  49. tcl_platform(user) = IIEUSER
  50. tcl_platform(wordSize) = 4
  51.  
  52. Setting x = "-0.000"
  53. Formatting x to %9.3f: " 0.000"
  54.  
  55. (testit) 2 %
  56.  
  57. 8511
  58.  
  59. (testit) 1 % source testit
  60. 'format' test script
  61. tcl_patchLevel = 8.5.11
  62. tcl_platform(byteOrder) = littleEndian
  63. tcl_platform(machine) = intel
  64. tcl_platform(os) = Windows NT
  65. tcl_platform(osVersion) = 5.1
  66. tcl_platform(platform) = windows
  67. tcl_platform(pointerSize) = 4
  68. tcl_platform(threaded) = 1
  69. tcl_platform(user) = IIEUSER
  70. tcl_platform(wordSize) = 4
  71.  
  72. Setting x = "-0.000"
  73. Formatting x to %9.3f: " 0.000"
  74.  
  75. (testit) 2 %
  76.  
  77. Using the same three binary tclkit interpreter files on new 64-bit Dell hardware gives:
  78. 8.6b
  79.  
  80. (testit) 1 % source testit
  81. 'format' test script
  82. tcl_patchLevel = 8.6b1.2
  83. tcl_platform(byteOrder) = littleEndian
  84. tcl_platform(machine) = intel
  85. tcl_platform(os) = Windows NT
  86. tcl_platform(osVersion) = 6.1
  87. tcl_platform(pathSeparator) = ;
  88. tcl_platform(platform) = windows
  89. tcl_platform(pointerSize) = 4
  90. tcl_platform(threaded) = 1
  91. tcl_platform(user) = photolog
  92. tcl_platform(wordSize) = 4
  93.  
  94. Setting x = "-0.000"
  95. Formatting x to %9.3f: " -0.000"
  96.  
  97. (testit) 2 %
  98.  
  99. 8510
  100.  
  101. (testit) 1 % source testit
  102. 'format' test script
  103. tcl_patchLevel = 8.5.10
  104. tcl_platform(byteOrder) = littleEndian
  105. tcl_platform(machine) = intel
  106. tcl_platform(os) = Windows NT
  107. tcl_platform(osVersion) = 6.1
  108. tcl_platform(platform) = windows
  109. tcl_platform(pointerSize) = 4
  110. tcl_platform(threaded) = 1
  111. tcl_platform(user) = photolog
  112. tcl_platform(wordSize) = 4
  113.  
  114. Setting x = "-0.000"
  115. Formatting x to %9.3f: " -0.000"
  116.  
  117. (testit) 2 %
  118.  
  119. 8511
  120.  
  121. (testit) 1 % source testit
  122. 'format' test script
  123. tcl_patchLevel = 8.5.11
  124. tcl_platform(byteOrder) = littleEndian
  125. tcl_platform(machine) = intel
  126. tcl_platform(os) = Windows NT
  127. tcl_platform(osVersion) = 6.1
  128. tcl_platform(platform) = windows
  129. tcl_platform(pointerSize) = 4
  130. tcl_platform(threaded) = 1
  131. tcl_platform(user) = photolog
  132. tcl_platform(wordSize) = 4
  133.  
  134. Setting x = "-0.000"
  135. Formatting x to %9.3f: " -0.000"
  136.  
  137. (testit) 2 %
  138.  
  139.  
  140.