[Freeipa-devel] [PATCH] 192 Replace float with Decimal

Martin Kosek mkosek at redhat.com
Fri Jan 13 20:02:26 UTC 2012


This patch fixes RHEL 6.2 build issue.
----
Having float type as a base type for floating point parameter in
ipalib introduces several issues, e.g. problem with representation
or value comparison. Python language provides Decimal type which
help overcome these issue.

This patch replaces a float type with Decimal type in Float
parameter. A precision attribute was added to Float parameter that
can be used to limit a number of decimal places in parameter
representation. This approach fixes a problem with API.txt
validation where comparison of float values may fail on different
architectures due to float representation error.

In order to safely transfer the parameter value over RPC it is
being converted to string which is then converted back to Decimal
number on server side.

https://fedorahosted.org/freeipa/ticket/2260

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-mkosek-192-replace-float-with-decimal.patch
Type: text/x-patch
Size: 26996 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120113/6f428004/attachment.bin>


More information about the Freeipa-devel mailing list