diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Serialize/FloatStringConversion.h |
Diffstat (limited to 'Runtime/Serialize/FloatStringConversion.h')
-rw-r--r-- | Runtime/Serialize/FloatStringConversion.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Runtime/Serialize/FloatStringConversion.h b/Runtime/Serialize/FloatStringConversion.h new file mode 100644 index 0000000..c93d143 --- /dev/null +++ b/Runtime/Serialize/FloatStringConversion.h @@ -0,0 +1,16 @@ +#if UNITY_EDITOR + +/// Converts float/double to and from strings. + +/// Binary exact float<-> string conversion functions. +/// Supports the full range of all float values, including nan, inf and denormalized values. + +bool FloatToStringAccurate (float f, char* buffer, size_t maximumSize); +bool DoubleToStringAccurate (double f, char* buffer, size_t maximumSize); + +bool FloatToStringAccurate (float f, UnityStr& output); +bool DoubleToStringAccurate (double f, UnityStr& output); + +float StringToFloatAccurate (const char* buffer); +double StringToDoubleAccurate (const char* buffer); +#endif
\ No newline at end of file |