diff options
Diffstat (limited to 'JavaScriptCore/wtf/dtoa.h')
| -rw-r--r-- | JavaScriptCore/wtf/dtoa.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/JavaScriptCore/wtf/dtoa.h b/JavaScriptCore/wtf/dtoa.h index 6127f53..3924a1c 100644 --- a/JavaScriptCore/wtf/dtoa.h +++ b/JavaScriptCore/wtf/dtoa.h @@ -21,27 +21,31 @@ #ifndef WTF_dtoa_h #define WTF_dtoa_h -namespace WTF { - class Mutex; -} +#include <wtf/unicode/Unicode.h> namespace WTF { +class Mutex; + +extern WTF::Mutex* s_dtoaP5Mutex; - extern WTF::Mutex* s_dtoaP5Mutex; +// s00: input string. Must not be 0 and must be terminated by 0. +// se: *se will have the last consumed character position + 1. +double strtod(const char* s00, char** se); - double strtod(const char* s00, char** se); +typedef char DtoaBuffer[80]; - typedef char DtoaBuffer[80]; - void dtoa(DtoaBuffer result, double d, int ndigits, int* decpt, int* sign, char** rve); +void dtoa(DtoaBuffer result, double dd, bool& sign, int& exponent, unsigned& precision); +void dtoaRoundSF(DtoaBuffer result, double dd, int ndigits, bool& sign, int& exponent, unsigned& precision); +void dtoaRoundDP(DtoaBuffer result, double dd, int ndigits, bool& sign, int& exponent, unsigned& precision); - // dtoa() for ECMA-262 'ToString Applied to the Number Type.' - // The *resultLength will have the length of the resultant string in bufer. - // The resultant string isn't terminated by 0. - void doubleToStringInJavaScriptFormat(double, DtoaBuffer, unsigned* resultLength); +// Size = 80 for sizeof(DtoaBuffer) + some sign bits, decimal point, 'e', exponent digits. +const unsigned NumberToStringBufferLength = 96; +typedef UChar NumberToStringBuffer[NumberToStringBufferLength]; +unsigned numberToString(double, NumberToStringBuffer); } // namespace WTF -using WTF::DtoaBuffer; -using WTF::doubleToStringInJavaScriptFormat; +using WTF::NumberToStringBuffer; +using WTF::numberToString; #endif // WTF_dtoa_h |
