chromium/v8/src/numbers/conversions-inl.h

// 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.

#ifndef V8_NUMBERS_CONVERSIONS_INL_H_
#define V8_NUMBERS_CONVERSIONS_INL_H_

#include <float.h>   // Required for DBL_MAX and on Win32 for finite()
#include <limits.h>  // Required for INT_MAX etc.
#include <stdarg.h>
#include <cmath>
#include "src/common/globals.h"  // Required for V8_INFINITY

// ----------------------------------------------------------------------------
// Extra POSIX/ANSI functions for Win32/MSVC.

#include "src/base/bits.h"
#include "src/base/numbers/double.h"
#include "src/base/platform/platform.h"
#include "src/numbers/conversions.h"
#include "src/objects/heap-number-inl.h"
#include "src/objects/smi-inl.h"

namespace v8 {
namespace internal {

// The fast double-to-unsigned-int conversion routine does not guarantee
// rounding towards zero, or any reasonable value if the argument is larger
// than what fits in an unsigned 32-bit integer.
inline unsigned int FastD2UI(double x) {}

// Adopted from https://gist.github.com/rygorous/2156668
inline uint16_t DoubleToFloat16(double value) {}

inline float DoubleToFloat32(double x) {}

// #sec-tointegerorinfinity
inline double DoubleToInteger(double x) {}

// Implements most of https://tc39.github.io/ecma262/#sec-toint32.
int32_t DoubleToInt32(double x) {}

// Implements https://heycam.github.io/webidl/#abstract-opdef-converttoint for
// the general case (step 1 and steps 8 to 12). Support for Clamp and
// EnforceRange will come in the future.
inline int64_t DoubleToWebIDLInt64(double x) {}

inline uint64_t DoubleToWebIDLUint64(double x) {}

bool DoubleToSmiInteger(double value, int* smi_int_value) {}

bool IsSmiDouble(double value) {}

bool IsInt32Double(double value) {}

bool IsUint32Double(double value) {}

bool DoubleToUint32IfEqualToSelf(double value, uint32_t* uint32_value) {}

int32_t NumberToInt32(Tagged<Object> number) {}

uint32_t NumberToUint32(Tagged<Object> number) {}

uint32_t PositiveNumberToUint32(Tagged<Object> number) {}

int64_t NumberToInt64(Tagged<Object> number) {}

uint64_t PositiveNumberToUint64(Tagged<Object> number) {}

bool TryNumberToSize(Tagged<Object> number, size_t* result) {}

size_t NumberToSize(Tagged<Object> number) {}

uint32_t DoubleToUint32(double x) {}

}  // namespace internal
}  // namespace v8

#endif  // V8_NUMBERS_CONVERSIONS_INL_H_