XML editor doesn't preserve entered numbers

Bug #1719412 reported by Roland Illig
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Unassigned

Bug Description

In Inkscape 0.92.2 (5c3e80d, 2017-08-06), the XML editor doesn't preserve the numbers I enter, even when they have few enough digits to be exactly representable.

As an example, create a circle and edit it using the XML editor. For the radius, enter "9.3". Then press Ctrl+Enter to commit this value. The value is autocorrected to 9.3000002. This is unexpected since when I enter "9.3" in the text field, I expect that the closest representable float/double value is actually stored in memory. And when converting that value back into a string, the shortest decimal representation should be chosen for that number.

Since typical C libraries don't implement this feature (neither does Python, but Java does), have a look at https://www.cs.indiana.edu/~dyb/pubs/FP-Printing-PLDI96.pdf and the references in that paper.

Revision history for this message
Alvin Penner (apenner) wrote :

confirmed on Windows 10, Inkscape 0.92.2 (5c3e80d, 2017-08-06)

<offtopic>
however, it is probably not fair to blame this on the XML editor, since there are a variety of other types of operations going on in the background, such as converting from document-units to px, and possibly back again, and scaling according to the size of the viewbox.
</offtopic>

Changed in inkscape:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.