Merge "Use FLT_ROUNDS in LP64 strtold."
This commit is contained in:
commit
9ceae0c9a6
@ -26,6 +26,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <float.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
extern "C" int __strtorQ(const char*, char**, int, void*);
|
extern "C" int __strtorQ(const char*, char**, int, void*);
|
||||||
@ -33,8 +34,7 @@ extern "C" int __strtorQ(const char*, char**, int, void*);
|
|||||||
long double strtold(const char* s, char** end_ptr) {
|
long double strtold(const char* s, char** end_ptr) {
|
||||||
#if __LP64__
|
#if __LP64__
|
||||||
long double result;
|
long double result;
|
||||||
// TODO: use the current rounding mode?
|
__strtorQ(s, end_ptr, FLT_ROUNDS, &result);
|
||||||
__strtorQ(s, end_ptr, 1 /* FPI_Round_near */, &result);
|
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
// This is fine for LP32 where long double is just double.
|
// This is fine for LP32 where long double is just double.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user