-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sign change when doing math gives invalid number #341
Comments
I'mm not sure where the "a" is coming from in your example when everything is done on the "x" key. Nor how it is possible to get Python to print a float as "--3.1415" at all. Suffice to say I could not reproduce the output posted (on Windows 11, Python 3.11, Tomlkit 0.11.8):
Please provide a minimal reproducible example and details of the environment. Until then I suggest this issue be closed. |
Hi James, thanks for your time! The 'a' is of course supposed to be a 'x'...
|
You're welcome. Sorry I thought it was Python producing the
Anyway, note that But you're quite right. Integer values in tables seem to cycle through +, +, +, -, ... when multiplied by -1 (i.e. not just +,-,+,-,...):
And Float values can never be negative at all:
|
Fix #341 Signed-off-by: Frost Ming <me@frostming.com>
Fix #341 Signed-off-by: Frost Ming <me@frostming.com>
Bug:
returns:
returns:
Subsequent parsing raises
tomlkit.exceptions.InvalidNumberError
.Of course there is an easy workaround using type conversion:
d['x'] = float(d['x'])*-1
.The text was updated successfully, but these errors were encountered: