mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-05 23:07:42 -05:00
Make all String float conversion methods be 64-bit
This commit is contained in:
@@ -242,7 +242,7 @@ class GetClassAndNamespace {
|
||||
if (code[idx] == '-' || (code[idx] >= '0' && code[idx] <= '9')) {
|
||||
//a number
|
||||
const CharType *rptr;
|
||||
double number = String::to_double(&code[idx], &rptr);
|
||||
double number = String::to_float(&code[idx], &rptr);
|
||||
idx += (rptr - &code[idx]);
|
||||
value = number;
|
||||
return TK_NUMBER;
|
||||
|
||||
@@ -209,7 +209,7 @@ TEST_CASE("[String] String to float") {
|
||||
static const double num[4] = { -12348298412.2, 0.05, 2.0002, -0.0001 };
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
CHECK(!(ABS(String(nums[i]).to_double() - num[i]) > 0.00001));
|
||||
CHECK(!(ABS(String(nums[i]).to_float() - num[i]) > 0.00001));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user