mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
LibC: Remove strtold impossible assert
Removed the impossible assertion of sizeof(double) == sizeof(long double) in strtold. This fixes the crash but suffers from lack of precision. Our eisel-lemire implementation on FloatingPointStringConversions needs a big overhaul to work properly with long doubles, especially with x87 80-bit extended precision format. Fixes #25791
This commit is contained in:
@@ -579,7 +579,8 @@ double strtod(char const* str, char** endptr)
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtold.html
|
||||
long double strtold(char const* str, char** endptr)
|
||||
{
|
||||
assert(sizeof(double) == sizeof(long double));
|
||||
// FIXME: eisel-lemire needs a deep overhaul to work with fp80 and fp128.
|
||||
// For now, we just implicitly cast to long double and accept the loss of precision.
|
||||
return strtod(str, endptr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user