From: Gary P. <gar...@gm...> - 2008-03-30 20:40:24
|
In [1]: 3 * 0.1 Out[1]: 0.30000000000000004 I.e., 3 * 0.1 > 0.3 The floating point gotcha, yet again. -g On Sat, Mar 29, 2008 at 11:13 PM, Joe Heafner <hea...@gm...> wrote: > When I type arange(1, 3, 1) I get [1, 2] as expected. When I type > arange(0.1, 0.3, 0.1) I get [0.1, 0.2] as expected. But when I type > arange(0.1, 3*0.1, 0.1) I get [0.1, 0.2, 0.3], which is not what would > expect. I can't find this behavior documented anywhere. What's going on? > > Joe > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |