| 1 | // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 | // for details. All rights reserved. Use of this source code is governed by a |
| 3 | // BSD-style license that can be found in the LICENSE file. |
| 4 | |
| 5 | #ifndef RUNTIME_VM_DOUBLE_CONVERSION_H_ |
| 6 | #define RUNTIME_VM_DOUBLE_CONVERSION_H_ |
| 7 | |
| 8 | #include "vm/allocation.h" |
| 9 | #include "vm/globals.h" |
| 10 | #include "vm/object.h" |
| 11 | |
| 12 | namespace dart { |
| 13 | |
| 14 | struct DoubleToStringConstants : AllStatic { |
| 15 | static char const kExponentChar; |
| 16 | static const char* const kInfinitySymbol; |
| 17 | static const char* const kNaNSymbol; |
| 18 | }; |
| 19 | |
| 20 | void DoubleToCString(double d, char* buffer, int buffer_size); |
| 21 | StringPtr DoubleToStringAsFixed(double d, int fraction_digits); |
| 22 | StringPtr DoubleToStringAsExponential(double d, int fraction_digits); |
| 23 | StringPtr DoubleToStringAsPrecision(double d, int precision); |
| 24 | |
| 25 | bool CStringToDouble(const char* str, intptr_t length, double* result); |
| 26 | |
| 27 | } // namespace dart |
| 28 | |
| 29 | #endif // RUNTIME_VM_DOUBLE_CONVERSION_H_ |
| 30 | |