Re: floating point woes

2011-02-15 Thread Mel
Hans-Peter Jansen wrote: > Hi, > > while I usually cope with the woes of floating point issues, this is > one, that I didn't expect: > round(2.385, 2) > 2.3799 > > Doesn't the docs say, it's rounded up for this case? > > > Values are rounded to the closest multiple of 10 to t

Re: floating point woes

2011-02-15 Thread Grant Edwards
On 2011-02-16, Hans-Peter Jansen wrote: > Thanks for the explanation, Benjamin. Not that I like it, but anyway. > If I hadn't quitted smoking a long time ago, I would go and ask, what > these engineers smoked during the course of inventing this sh*t. Like most tools, IEEE floating point works br

Re: floating point woes

2011-02-15 Thread Grant Edwards
On 2011-02-16, Ian Kelly wrote: > On Tue, Feb 15, 2011 at 4:49 PM, Hans-Peter Jansen wrote: >> >> while I usually cope with the woes of floating point issues, this is >> one, that I didn't expect: >> > round(2.385, 2) >> 2.3799 >> >> Doesn't the docs say, it's rounded up for this

Re: floating point woes

2011-02-15 Thread Hans-Peter Jansen
On Wednesday 16 February 2011, 01:24:59 Chris Rebert wrote: > On Tue, Feb 15, 2011 at 4:09 PM, Chris Rebert wrote: > > On Tue, Feb 15, 2011 at 3:49 PM, Hans-Peter Jansen wrote: > >> Hi, > >> > >> while I usually cope with the woes of floating point issues, this > >> is > >> > >> one, that I did

Re: floating point woes

2011-02-15 Thread Hans-Peter Jansen
On Wednesday 16 February 2011, 01:06:08 Benjamin Kaplan wrote: > On Tue, Feb 15, 2011 at 6:49 PM, Hans-Peter Jansen wrote: > > Hi, > > > > while I usually cope with the woes of floating point issues, this > > is > > > > one, that I didn't expect: > round(2.385, 2) > > > > 2.3799

Re: floating point woes

2011-02-15 Thread Chris Rebert
On Tue, Feb 15, 2011 at 4:09 PM, Chris Rebert wrote: > On Tue, Feb 15, 2011 at 3:49 PM, Hans-Peter Jansen wrote: >> Hi, >> >> while I usually cope with the woes of floating point issues, this is >> one, that I didn't expect: >> > round(2.385, 2) >> 2.3799 >> >> Doesn't the docs sa

Re: floating point woes

2011-02-15 Thread Chris Rebert
On Tue, Feb 15, 2011 at 3:49 PM, Hans-Peter Jansen wrote: > Hi, > > while I usually cope with the woes of floating point issues, this is > one, that I didn't expect: > round(2.385, 2) > 2.3799 > > Doesn't the docs say, it's rounded up for this case? > > > Values are rounded to th

Re: floating point woes

2011-02-15 Thread Ian Kelly
On Tue, Feb 15, 2011 at 4:49 PM, Hans-Peter Jansen wrote: > Hi, > > while I usually cope with the woes of floating point issues, this is > one, that I didn't expect: > round(2.385, 2) > 2.3799 > > Doesn't the docs say, it's rounded up for this case? > > > Values are rounded to th

Re: floating point woes

2011-02-15 Thread Benjamin Kaplan
On Tue, Feb 15, 2011 at 6:49 PM, Hans-Peter Jansen wrote: > Hi, > > while I usually cope with the woes of floating point issues, this is > one, that I didn't expect: > round(2.385, 2) > 2.3799 > > Doesn't the docs say, it's rounded up for this case? > > > Values are rounded to th

Re: floating point woes

2011-02-15 Thread Westley Martínez
On Wed, 2011-02-16 at 00:49 +0100, Hans-Peter Jansen wrote: > Hi, > > while I usually cope with the woes of floating point issues, this is > one, that I didn't expect: > > >>> round(2.385, 2) > 2.3799 > > Doesn't the docs say, it's rounded up for this case? > > > Values are rounde

Re: floating point woes

2011-02-15 Thread André Roberge
On Tuesday, February 15, 2011 7:49:34 PM UTC-4, Hans-Peter Jansen wrote: > Hi, > > while I usually cope with the woes of floating point issues, this is > one, that I didn't expect: > > >>> round(2.385, 2) > 2.3799 > > Doesn't the docs say, it's rounded up for this case? The problem

floating point woes

2011-02-15 Thread Hans-Peter Jansen
Hi, while I usually cope with the woes of floating point issues, this is one, that I didn't expect: >>> round(2.385, 2) 2.3799 Doesn't the docs say, it's rounded up for this case? Values are rounded to the closest multiple of 10 to the power minus n; if two multiples are equally