Hi Andy!

On 24.04.2016 14:17, andy pugh wrote:
> On 24 April 2016 at 13:05, John Thornton <[email protected]> wrote:
>> what a crazy step increment, where is that at?
> 
> 
> These are what end up in the .ui file even though sensible numbers are
> entered in the Glade editor.
> However, many numbers have come out correctly. It's a bit strange.
> 

It's not actually strange, that's just the behaviour of floating point
numbers. If printed without rounding, such results are not uncommon. You
can try this in a console:

$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 0.05+0.1
0.15000000000000002

0.15 can't be exactly represented as a binary fraction (just like 1/3
can't be exactly represented in either decimal or binary). Those
artifacts are usually rounded away, though:

>>> str(0.05+0.1)
'0.15'

So it just depends on how the value is printed. That glade stores the
number in full precision is absolutely sensible, but they should not go
out to the interpreter like this, if it can't handle numbers in
exponential format.

Bye,
Philipp

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to