I can see from the code below:
https://github.com/trinodb/trino-csharp-client/blob/main/trino-csharp/Trino.Client/Types/BigDecimal.cs#L23
the code below:
public TrinoBigDecimal(string value) {
var parts = value.Split('.');
integerPart = BigInteger.Parse(parts[0]);
fractionalPart = parts.Length > 1 ? BigInteger.Parse(parts[1]) : BigInteger.Zero;
scale = parts.Length > 1 ? parts[1].Length : 0;
Validate();
}
The line integerPart = BigInteger.Parse(parts[0]); can have the -0.6 case wrongly interpreted as 0.6, the integral part when it is -0, this parse function will make it as 0. The sign information will be lost entirely.
I think there should be a 'Sign' member variable for this class.
I can see from the code below:
https://github.com/trinodb/trino-csharp-client/blob/main/trino-csharp/Trino.Client/Types/BigDecimal.cs#L23
the code below:
The line
integerPart = BigInteger.Parse(parts[0]);can have the-0.6case wrongly interpreted as0.6, the integral part when it is-0, this parse function will make it as0. The sign information will be lost entirely.I think there should be a 'Sign' member variable for this class.