1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 17:08:00 +02:00

Use RemoveFromStart in Float.Parse

This commit is contained in:
disarray2077 2022-02-15 14:27:26 -03:00 committed by GitHub
parent 3ff67cfd7b
commit d0673115d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -180,15 +180,18 @@ namespace System
double result = 0;
double decimalMultiplier = 0;
if (val.Equals(info.NegativeInfinitySymbol, true))
var val;
val.RemoveFromStart(offset);
if (@val.Equals(info.NegativeInfinitySymbol, true))
return NegativeInfinity;
else if (val.Substring(offset).Equals(info.PositiveInfinitySymbol, true))
else if (val.Equals(info.PositiveInfinitySymbol, true))
return PositiveInfinity;
else if (val.Substring(offset).Equals(info.NaNSymbol, true))
else if (val.Equals(info.NaNSymbol, true))
return NaN;
//TODO: Use Number.ParseNumber
for (int32 i = offset; i < val.Length - offset; i++)
for (int32 i = 0; i < val.Length; i++)
{
char8 c = val.Ptr[i];