chromium/v8/src/base/numbers/fixed-dtoa.cc

// Copyright 2011 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/base/numbers/fixed-dtoa.h"

#include <stdint.h>

#include <cmath>

#include "src/base/logging.h"
#include "src/base/numbers/double.h"

namespace v8 {
namespace base {

// Represents a 128bit type. This class should be replaced by a native type on
// platforms that support 128bit integers.
class UInt128 {};

static const int kDoubleSignificandSize =;  // Includes the hidden bit.

static void FillDigits32FixedLength(uint32_t number, int requested_length,
                                    Vector<char> buffer, int* length) {}

static void FillDigits32(uint32_t number, Vector<char> buffer, int* length) {}

static void FillDigits64FixedLength(uint64_t number, int requested_length,
                                    Vector<char> buffer, int* length) {}

static void FillDigits64(uint64_t number, Vector<char> buffer, int* length) {}

static void DtoaRoundUp(Vector<char> buffer, int* length, int* decimal_point) {}

// The given fractionals number represents a fixed-point number with binary
// point at bit (-exponent).
// Preconditions:
//   -128 <= exponent <= 0.
//   0 <= fractionals * 2^exponent < 1
//   The buffer holds the result.
// The function will round its result. During the rounding-process digits not
// generated by this function might be updated, and the decimal-point variable
// might be updated. If this function generates the digits 99 and the buffer
// already contained "199" (thus yielding a buffer of "19999") then a
// rounding-up will change the contents of the buffer to "20000".
static void FillFractionals(uint64_t fractionals, int exponent,
                            int fractional_count, Vector<char> buffer,
                            int* length, int* decimal_point) {}

// Removes leading and trailing zeros.
// If leading zeros are removed then the decimal point position is adjusted.
static void TrimZeros(Vector<char> buffer, int* length, int* decimal_point) {}

bool FastFixedDtoa(double v, int fractional_count, Vector<char> buffer,
                   int* length, int* decimal_point) {}

}  // namespace base
}  // namespace v8