[xml] More floating point "issues"
- From: "Richard Jinks" <cyberthymia yahoo co uk>
- To: <xml gnome org>
- Subject: [xml] More floating point "issues"
- Date: Tue, 9 Apr 2002 15:27:24 +0100
Hi
Last problem with floating point numbers, I hope...
(Well, these are the last of the regression tests I've been playing with,
anyway!)
According to the XPath spec, scientific notation is not allowed at all
(i.e. 1e-4).
This applies both to converting numbers to strings, and strings to numbers.
Libxml currently outputs "1e-6" instead of "0.000001", and will happily
accept "1e-6" as a valid number instead of converting it to "NaN".
Also, when converting from numbers to strings ONLY, it is valid to have a
number with no digits before or after the decimal point (but not both),
i.e. ".4" and "4." are both valid, "." isn't.
Of these cases, libxml only complains about numbers with no leading digits
(".4") giving an "Invalid expression" error.
I've done a fix for all three cases, but I wanted to check with you about
the problem with scientific numbers, esp since you've put specific cases
in the code to handle them. My guess is that libxml should probably never
output numbers in this format (i.e. should always output "0.000001"),
but do you want to stop this notation being used when inputting numbers?
Thanks,
Richard
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]