Merge branch 'whitespace'

Conflicts:
	Changelog
	src/double-conversion.cc
	src/double-conversion.h
diff --git a/AUTHORS b/AUTHORS
index 8a170b5..a5c45a2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -5,6 +5,9 @@
 #   Name/Organization <email address>
 
 Google Inc.
+Mozilla Foundation
 
 Jeff Muizelaar <jmuizelaar@mozilla.com>
+Mike Hommey <mhommey@mozilla.com>
 Martin Olsson <mnemo@minimum.se>
+Kent Williams <chaircrusher@gmail.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..5bf382e
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,89 @@
+cmake_minimum_required(VERSION 2.8)
+project(double-conversion)
+
+# pick a version #
+set(double-conversion_VERSION
+  1.1.1)
+
+# set paths for install -- empty initially
+# Offer the user the choice of overriding the installation directories
+set(INSTALL_BIN_DIR CACHE PATH "Installation directory for libraries")
+set(INSTALL_LIB_DIR CACHE PATH "Installation directory for libraries")
+set(INSTALL_INCLUDE_DIR CACHE PATH "Installation directory for include")
+# set suffix for CMake files used for packaging
+if(WIN32 AND NOT CYGWIN)
+  set(INSTALL_CMAKE_DIR CMake)
+else()
+  set(INSTALL_CMAKE_DIR lib/CMake/double-conversion)
+endif()
+
+# Make relative paths absolute (needed later)
+foreach(p LIB BIN INCLUDE CMAKE)
+  set(var INSTALL_${p}_DIR)
+  if(NOT IS_ABSOLUTE "${${var}}")
+    set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
+  endif()
+endforeach()
+
+#
+# set up include dirs
+include_directories("${PROJECT_SOURCE_DIR}/src"
+  "${PROJECT_BINARY_DIR}"
+  )
+
+# Add src subdirectory
+add_subdirectory(src)
+
+#
+# set up testing if requested
+option(BUILD_TESTING "Build test programs" OFF)
+if(BUILD_TESTING)
+  enable_testing()
+  include(CTest)
+  add_subdirectory(test)
+endif()
+
+#
+# mention the library target as export library
+export(TARGETS double-conversion
+  FILE "${PROJECT_BINARY_DIR}/double-conversionLibraryDepends.cmake")
+
+#
+# set this build as an importable package
+export(PACKAGE double-conversion)
+
+#
+# make a cmake file -- in this case, all that needs defining
+# is double-conversion_INCLUDE_DIRS
+configure_file(double-conversionBuildTreeSettings.cmake.in
+  "${PROJECT_BINARY_DIR}/double-conversionBuildTreeSettings.cmake"
+  @ONLY)
+
+#
+# determine where include is relative to the CMake dir in
+# in installed tree
+file(RELATIVE_PATH CONF_REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}"
+  "${INSTALL_INCLUDE_DIR}")
+
+#
+# sets up config to be used by CMake find_package
+configure_file(double-conversionConfig.cmake.in
+  "${PROJECT_BINARY_DIR}/double-conversionConfig.cmake"
+  @ONLY)
+#
+# Export version # checked by find_package
+configure_file(double-conversionConfigVersion.cmake.in
+  "${PROJECT_BINARY_DIR}/double-conversionConfigVersion.cmake"
+  @ONLY)
+#
+# install config files for find_package
+install(FILES
+  "${PROJECT_BINARY_DIR}/double-conversionConfig.cmake"
+  "${PROJECT_BINARY_DIR}/double-conversionConfigVersion.cmake"
+  DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)
+
+
+#
+# generates install cmake files to find libraries in installation.
+install(EXPORT double-conversionLibraryDepends DESTINATION
+  "${INSTALL_CMAKE_DIR}" COMPONENT dev)
diff --git a/Changelog b/Changelog
index ce8d9c9..7125a70 100644
--- a/Changelog
+++ b/Changelog
@@ -1,8 +1,19 @@
-2012-04-08:
+2013-11-09:
+  Tagged v2.0.0.
   String-to-Double|Float: ALLOW_LEADING_SPACES and similar flags now include
   new-lines, tabs and all Unicode whitespace characters.
-  This is a potentially breaking change and the version number is therefore
-  bumped to v2.0.
+
+2013-11-09:
+  Tagged v1.1.2.
+  Add support for ARM 64 and OsX ppc.
+  Rewrite tests so they pass under Visual Studio.
+  Add CMake build system support.
+  Fix warnings.
+
+2012-06-10:
+  Tagged v1.1.1.
+  Null terminate exponent buffer (only an issue when asserts are enabled).
+  Support more architectures.
 
 2012-02-05:
   Merged in Single-branch with single-precision support.
diff --git a/SConstruct b/SConstruct
index b99496c..3c51288 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2,7 +2,7 @@
 double_conversion_test_sources = ['test/cctest/' + x for x in SConscript('test/cctest/SConscript')]
 test = double_conversion_sources + double_conversion_test_sources
 print(test)
-env = Environment(CPPPATH='#/src')
+env = Environment(CPPPATH='#/src', LIBS=['m', 'stdc++'])
 debug = ARGUMENTS.get('debug', 0)
 optimize = ARGUMENTS.get('optimize', 0)
 if int(debug):
diff --git a/double-conversionBuildTreeSettings.cmake.in b/double-conversionBuildTreeSettings.cmake.in
new file mode 100644
index 0000000..f46705d
--- /dev/null
+++ b/double-conversionBuildTreeSettings.cmake.in
@@ -0,0 +1,2 @@
+set(double-conversion_INCLUDE_DIRS
+  "@PROJECT_SOURCE_DIR@/src")
diff --git a/double-conversionConfig.cmake.in b/double-conversionConfig.cmake.in
new file mode 100644
index 0000000..bbe784b
--- /dev/null
+++ b/double-conversionConfig.cmake.in
@@ -0,0 +1,17 @@
+# - Config file for the double-conversion package
+# It defines the following variables
+# double-conversion_INCLUDE_DIRS
+# double-conversion_LIBRARIES
+
+get_filename_component(double-conversion_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+if(EXISTS "${double-conversion_CMAKE_DIR}/CMakeCache.txt")
+  include("${double-conversion_CMAKE_DIR}/double-conversionBuildTreeSettings.cmake")
+else()
+  set(double-conversion_INCLUDE_DIRS
+    "${double-conversion_CMAKE_DIR}/@CONF_REL_INCLUDE_DIR@/include/double-conversion")
+endif()
+
+include("${double-conversion_CMAKE_DIR}/double-conversionLibraryDepends.cmake")
+
+set(double-conversion_LIBRARIES double-conversion)
diff --git a/double-conversionConfigVersion.cmake.in b/double-conversionConfigVersion.cmake.in
new file mode 100644
index 0000000..0f2295d
--- /dev/null
+++ b/double-conversionConfigVersion.cmake.in
@@ -0,0 +1,11 @@
+set(PACKAGE_VERSION "@double-conversion_VERSION@")
+ 
+# Check whether the requested PACKAGE_FIND_VERSION is compatible
+if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
+  set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+  set(PACKAGE_VERSION_COMPATIBLE TRUE)
+  if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
+    set(PACKAGE_VERSION_EXACT TRUE)
+  endif()
+endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..7f5c985
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,42 @@
+
+set(headers
+  bignum.h
+  cached-powers.h
+  diy-fp.h
+  double-conversion.h
+  fast-dtoa.h
+  fixed-dtoa.h
+  ieee.h
+  strtod.h
+  utils.h
+  )
+
+add_library(double-conversion
+bignum.cc
+bignum-dtoa.cc
+cached-powers.cc
+diy-fp.cc
+double-conversion.cc
+fast-dtoa.cc
+fixed-dtoa.cc
+strtod.cc
+${headers}
+)
+
+#
+# associates the list of headers with the library
+# for the purposes of installation/import into other projects
+set_target_properties(double-conversion
+    PROPERTIES PUBLIC_HEADER "${headers}")
+
+#
+# install command to set up library install
+# given the above PUBLIC_HEADER property set, this
+# pulls along all the header files with the library.
+install(TARGETS double-conversion
+  EXPORT double-conversionLibraryDepends
+  RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin
+  LIBRARY DESTINATION "${INSTALL_LIB_DIR}/lib" COMPONENT shlib
+  ARCHIVE DESTINATION "${INSTALL_LIB_DIR}/lib" COMPONENT lib
+  PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}/include/double-conversion"
+  COMPONENT dev)
diff --git a/src/bignum.cc b/src/bignum.cc
index 747491a..dc8a2a6 100644
--- a/src/bignum.cc
+++ b/src/bignum.cc
@@ -501,8 +501,8 @@
   // Start by removing multiples of 'other' until both numbers have the same
   // number of digits.
   while (BigitLength() > other.BigitLength()) {
-    // This naive approach is extremely inefficient if the this divided other
-    // might be big. This function is implemented for doubleToString where
+    // This naive approach is extremely inefficient if `this` divided by other
+    // is big. This function is implemented for doubleToString where
     // the result should be small (less than 10).
     ASSERT(other.bigits_[other.used_digits_ - 1] >= ((1 << kBigitSize) / 16));
     // Remove the multiples of the first digit.
@@ -755,7 +755,6 @@
     Chunk difference = bigits_[i] - borrow;
     bigits_[i] = difference & kBigitMask;
     borrow = difference >> (kChunkSize - 1);
-    ++i;
   }
   Clamp();
 }
diff --git a/src/double-conversion.cc b/src/double-conversion.cc
index 32e8630..d2893f5 100644
--- a/src/double-conversion.cc
+++ b/src/double-conversion.cc
@@ -98,7 +98,8 @@
   }
   ASSERT(exponent < 1e4);
   const int kMaxExponentLength = 5;
-  char buffer[kMaxExponentLength];
+  char buffer[kMaxExponentLength + 1];
+  buffer[kMaxExponentLength] = '\0';
   int first_char_pos = kMaxExponentLength;
   while (exponent > 0) {
     buffer[--first_char_pos] = '0' + (exponent % 10);
@@ -602,10 +603,11 @@
 
 
 template <class Iterator>
-double StringToDoubleConverter::StringToIeee(Iterator input,
-                                             int length,
-                                             bool read_as_double,
-                                             int* processed_characters_count) {
+double StringToDoubleConverter::StringToIeee(
+    Iterator input,
+    int length,
+    bool read_as_double,
+    int* processed_characters_count) const {
   Iterator current = input;
   Iterator end = input + length;
 
diff --git a/src/double-conversion.h b/src/double-conversion.h
index 33bc97c..7bc58ba 100644
--- a/src/double-conversion.h
+++ b/src/double-conversion.h
@@ -503,7 +503,7 @@
   // in the 'processed_characters_count'. Trailing junk is never included.
   double StringToDouble(const char* buffer,
                         int length,
-                        int* processed_characters_count);
+                        int* processed_characters_count) const;
 
   // Same as StringToDouble above but for 16 bit characters.
   double StringToDouble(const uc16* buffer,
@@ -515,7 +515,7 @@
   // due to potential double-rounding.
   float StringToFloat(const char* buffer,
                       int length,
-                      int* processed_characters_count);
+                      int* processed_characters_count) const;
 
   // Same as StringToFloat above but for 16 bit characters.
   float StringToFloat(const uc16* buffer,
@@ -533,7 +533,7 @@
   double StringToIeee(Iterator start_pointer,
                       int length,
                       bool read_as_double,
-                      int* processed_characters_count);
+                      int* processed_characters_count) const;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter);
 };
diff --git a/src/strtod.cc b/src/strtod.cc
index 1f5fd66..9758989 100644
--- a/src/strtod.cc
+++ b/src/strtod.cc
@@ -519,7 +519,7 @@
 
   // If the guess doesn't lie near a single-precision boundary we can simply
   // return its float-value.
-  if ((f1 == f4)) {
+  if (f1 == f4) {
     return float_guess;
   }
 
diff --git a/src/utils.h b/src/utils.h
index d5e994f..c76f77d 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -33,7 +33,10 @@
 
 #include <assert.h>
 #ifndef ASSERT
-#define ASSERT(condition)      (assert(condition))
+#define ASSERT(condition)         \
+  do {                            \
+    assert(condition);            \
+  } while (false && (condition))
 #endif
 #ifndef UNIMPLEMENTED
 #define UNIMPLEMENTED() (abort())
@@ -53,10 +56,16 @@
 // disabled.)
 // On Linux,x86 89255e-22 != Div_double(89255.0/1e22)
 #if defined(_M_X64) || defined(__x86_64__) || \
-    defined(__ARMEL__) || \
-    defined(_MIPS_ARCH_MIPS32R2)
+    defined(__ARMEL__) || defined(__avr32__) || \
+    defined(__hppa__) || defined(__ia64__) || \
+    defined(__mips__) || \
+    defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
+    defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
+    defined(__SH4__) || defined(__alpha__) || \
+    defined(_MIPS_ARCH_MIPS32R2) || \
+    defined(_AARCH64EL_)
 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
-#elif defined(_M_IX86) || defined(__i386__)
+#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
 #if defined(_WIN32)
 // Windows uses a 64bit wide floating point stack.
 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
@@ -67,6 +76,11 @@
 #error Target architecture was not detected as supported by Double-Conversion.
 #endif
 
+#if defined(__GNUC__)
+#define DOUBLE_CONVERSION_UNUSED __attribute__((unused))
+#else
+#define DOUBLE_CONVERSION_UNUSED
+#endif
 
 #if defined(_WIN32) && !defined(__MINGW32__)
 
@@ -294,7 +308,8 @@
 inline Dest BitCast(const Source& source) {
   // Compile time assertion: sizeof(Dest) == sizeof(Source)
   // A compile error here means your Dest and Source have different sizes.
-  typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
+  DOUBLE_CONVERSION_UNUSED
+      typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
 
   Dest dest;
   memmove(&dest, &source, sizeof(dest));
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..3cf4449
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(cctest)
\ No newline at end of file
diff --git a/test/cctest/CMakeLists.txt b/test/cctest/CMakeLists.txt
new file mode 100644
index 0000000..cdb5538
--- /dev/null
+++ b/test/cctest/CMakeLists.txt
@@ -0,0 +1,50 @@
+
+set(CCTEST_SRC
+  cctest.cc
+  gay-fixed.cc
+  gay-precision.cc
+  gay-shortest.cc
+  gay-shortest-single.cc
+  test-bignum.cc
+  test-bignum-dtoa.cc
+  test-conversions.cc
+  test-diy-fp.cc
+  test-dtoa.cc
+  test-fast-dtoa.cc
+  test-fixed-dtoa.cc
+  test-ieee.cc
+  test-strtod.cc
+)
+
+add_executable(cctest ${CCTEST_SRC})
+target_link_libraries(cctest double-conversion)
+
+add_test(NAME test_bignum
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-bignum)
+
+add_test(NAME test_bignum_dtoa
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-bignum-dtoa)
+
+add_test(NAME test_conversions
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-conversions)
+add_test(NAME test_diy_fp
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-diy-fp)
+add_test(NAME test_dtoa
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-dtoa)
+add_test(NAME test_fast_dtoa
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-fast-dtoa)
+add_test(NAME test_fixed_dtoa
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-fixed-dtoa)
+add_test(NAME test_ieee
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-ieee)
+add_test(NAME test_strtod
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  COMMAND $<TARGET_FILE:cctest> test-strtod)
diff --git a/test/cctest/test-bignum-dtoa.cc b/test/cctest/test-bignum-dtoa.cc
index be8fb25..4f618ac 100644
--- a/test/cctest/test-bignum-dtoa.cc
+++ b/test/cctest/test-bignum-dtoa.cc
@@ -282,7 +282,7 @@
   CHECK_EQ("332307", buffer.start());
   CHECK_EQ(36, point);
 
-  BignumDtoa(1.23405349260765015351e-41f, BIGNUM_DTOA_SHORTEST_SINGLE, 0,
+  BignumDtoa(1.2341e-41f, BIGNUM_DTOA_SHORTEST_SINGLE, 0,
              buffer, &length, &point);
   CHECK_EQ("12341", buffer.start());
   CHECK_EQ(-40, point);
diff --git a/test/cctest/test-fast-dtoa.cc b/test/cctest/test-fast-dtoa.cc
index 3b363ec..0b6915e 100644
--- a/test/cctest/test-fast-dtoa.cc
+++ b/test/cctest/test-fast-dtoa.cc
@@ -32,7 +32,7 @@
   Vector<char> buffer(buffer_container, kBufferSize);
   int length;
   int point;
-  int status;
+  bool status;
 
   double min_double = 5e-324;
   status = FastDtoa(min_double, FAST_DTOA_SHORTEST, 0,
@@ -102,7 +102,7 @@
   Vector<char> buffer(buffer_container, kBufferSize);
   int length;
   int point;
-  int status;
+  bool status;
 
   float min_float = 1e-45f;
   status = FastDtoa(min_float, FAST_DTOA_SHORTEST_SINGLE, 0,
@@ -131,7 +131,7 @@
   CHECK_EQ("332307", buffer.start());
   CHECK_EQ(36, point);
 
-  status = FastDtoa(1.23405349260765015351e-41f, FAST_DTOA_SHORTEST_SINGLE, 0,
+  status = FastDtoa(1.2341e-41f, FAST_DTOA_SHORTEST_SINGLE, 0,
                     buffer, &length, &point);
   CHECK(status);
   CHECK_EQ("12341", buffer.start());
@@ -178,7 +178,7 @@
   Vector<char> buffer(buffer_container, kBufferSize);
   int length;
   int point;
-  int status;
+  bool status;
 
   status = FastDtoa(1.0, FAST_DTOA_PRECISION, 3, buffer, &length, &point);
   CHECK(status);
diff --git a/test/cctest/test-strtod.cc b/test/cctest/test-strtod.cc
index bd50cc4..c5950eb 100644
--- a/test/cctest/test-strtod.cc
+++ b/test/cctest/test-strtod.cc
@@ -515,8 +515,8 @@
   CHECK_EQ(3401e34f, StrtofChar("00000340100000", 29));
   CHECK_EQ(Single::Infinity(), StrtofChar("00000341000000", 30));
   CHECK_EQ(34e37f, StrtofChar("000003400000", 32));
-  CHECK_EQ(3.4028235676e+38f, StrtofChar("34028235676", 28));
-  CHECK_EQ(3.4028235677e+38f, StrtofChar("34028235677", 28));
+  CHECK_EQ(3.4028234e+38f, StrtofChar("34028235676", 28));
+  CHECK_EQ(3.4028234e+38f, StrtofChar("34028235677", 28));
   CHECK_EQ(Single::Infinity(), StrtofChar("34028235678", 28));
 
   // The following number is the result of 89255.0/1e-22. Both floating-point
@@ -538,7 +538,12 @@
   // Verify that we don't double round.
   // Get the boundary of the boundary.
   CHECK_EQ(2.1665680640000002384185791015625e9, 2166568064.0);
+  // Visual Studio gets this wrong and believes that these two numbers are the
+  // same doubles. We want to test our conversion and not the compiler. We
+  // therefore disable the check.
+#ifndef _MSC_VER
   CHECK(2.16656806400000023841857910156251e9 != 2166568064.0);
+#endif
   CHECK_EQ(2166568192.0f, StrtofChar("21665680640000002384185791015625", -22));
 
   // 0x4fffffff = 8589934080
@@ -551,8 +556,13 @@
   CHECK_EQ(8589934592.0f, StrtofChar("858993433600001", -5));
   // Verify that we don't double round.
   // Get the boundary of the boundary.
+  // Visual Studio gets this wrong. To avoid failing tests because of a broken
+  // compiler we disable the following two tests. They were only testing the
+  // compiler. The real test is still active.
+#ifndef _MSC_VER
   CHECK_EQ(8.589934335999999523162841796875e+09, 8589934336.0);
   CHECK(8.5899343359999995231628417968749e+09 != 8589934336.0);
+#endif
   CHECK_EQ(8589934080.0f, StrtofChar("8589934335999999523162841796875", -21));
 
   // 0x4f000000 = 2147483648
@@ -649,7 +659,7 @@
     for (int i = 0; i < kShortStrtodRandomCount; ++i) {
       int pos = 0;
       for (int j = 0; j < length; ++j) {
-        buffer[pos++] = random() % 10 + '0';
+        buffer[pos++] = DeterministicRandom() % 10 + '0';
       }
       int exponent = DeterministicRandom() % (25*2 + 1) - 25 - length;
       buffer[pos] = '\0';
@@ -662,7 +672,7 @@
     for (int i = 0; i < kLargeStrtodRandomCount; ++i) {
       int pos = 0;
       for (int j = 0; j < length; ++j) {
-        buffer[pos++] = random() % 10 + '0';
+        buffer[pos++] = DeterministicRandom() % 10 + '0';
       }
       int exponent = DeterministicRandom() % (308*2 + 1) - 308 - length;
       buffer[pos] = '\0';
@@ -716,7 +726,7 @@
     for (int i = 0; i < kShortStrtofRandomCount; ++i) {
       int pos = 0;
       for (int j = 0; j < length; ++j) {
-        buffer[pos++] = random() % 10 + '0';
+        buffer[pos++] = DeterministicRandom() % 10 + '0';
       }
       int exponent = DeterministicRandom() % (5*2 + 1) - 5 - length;
       buffer[pos] = '\0';
@@ -729,7 +739,7 @@
     for (int i = 0; i < kLargeStrtofRandomCount; ++i) {
       int pos = 0;
       for (int j = 0; j < length; ++j) {
-        buffer[pos++] = random() % 10 + '0';
+        buffer[pos++] = DeterministicRandom() % 10 + '0';
       }
       int exponent = DeterministicRandom() % (38*2 + 1) - 38 - length;
       buffer[pos] = '\0';