On 28 Oct 2008, at 11:11 am, Henning Thielemann wrote:
In measured data the .5-case should be very rare - a "null set"?
However I assume that .5 happens more often in practice - because of
prior rounding,
Think about money.
When I was a child, farthings (1/4 of a penny) had just been
dropped
On 27 Oct 2008, at 11:00 pm, Henning Thielemann wrote:
On Mon, 27 Oct 2008, L.Guo wrote:
I think this is unresonable. then try it in GHC 6.8.3.
Prelude> round 3.5
4
Prelude> round 2.5
2
Is there any explanation about that ?
It's the definition we learnt in school ...
Check
http://en
G'day all.
Henning Thielemann suggested:
In measured data the .5-case should be very rare - a "null set"?
However I assume that .5 happens more often in practice - because of
prior rounding, which was shown to be bad practice in this thread.
The usual case in floating point is usually not
G'day all.
Quoting "Mitchell, Neil" <[EMAIL PROTECTED]>:
With rounding to the nearest even integer for 0.5's you get 6, otherwise
if you always round up you get 7. If you bias towards rounding up you
get a general upwards trend as numbers are rounded, which is bad, while
the even condition ensu
On Mon, 27 Oct 2008, Janis Voigtlaender wrote:
Lennart Augustsson wrote:
I can't remember the method being called anything.
It was just what we were being taught. With the obvious explanation
that .5 is right in the middle so always going one way would introduce
a bias. This was circa 1969.
On Mon, 27 Oct 2008, Ketil Malde wrote:
Of course, Haskell should discard the rather tasteless IEEE754 crud,
and do its calculations on infinite streams of digits. Then, rounding
upwards after 'take'ing a sufficient amount of decimals will be the
right thing to do.
When I implemented just th
L.Guo wrote:
Hi all:
I just read about definitions of Prelude [1], and noticing that.
In 6.4.6 Coercions and Component Extraction, it discribes like this:
"round x returns the nearest integer to x, the even integer if x is equidistant
between two integers."
I think this is unresonable. th
It's well known from numerical analysis that you can achieve the best
general behavior by rounding to even in "half" the cases, and rounding
to odd in "half" the cases. It's usually deterministic by looking at
the digit to the right of the round point.
Regards,
John A. De Goes
N-BRAIN, I
Ketil Malde wrote:
Of course, Haskell should discard the rather tasteless IEEE754 crud,
and do its calculations on infinite streams of digits. Then, rounding
upwards after 'take'ing a sufficient amount of decimals will be the
right thing to do.
Except arbitrary-precision real arithmetic is not
This behaviour is not what I expect after reading the description at
http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:round
. Given that this behaviour has caused a bit of confusion I think a
change to the documention might be in order.
The authority here is the report whic
Ketil Malde wrote:
Janis Voigtlaender <[EMAIL PROTECTED]> writes:
Since just about every floating point operation involves some sort of
loss of precision, repeated rounding is a fact of life.
Of course. But that was not the point of the discussion...
Well, allow me to contribute to kee
Janis Voigtlaender <[EMAIL PROTECTED]> writes:
>> Since just about every floating point operation involves some sort of
>> loss of precision, repeated rounding is a fact of life.
> Of course. But that was not the point of the discussion...
Well, allow me to contribute to keeping the discussion
On 2008 Oct 27, at 6:00, Henning Thielemann wrote:
On Mon, 27 Oct 2008, L.Guo wrote:
I think this is unresonable. then try it in GHC 6.8.3.
Prelude> round 3.5
4
Prelude> round 2.5
2
Is there any explanation about that ?
It's the definition we learnt in school ...
Maybe you did; I learned "
[1] The Haskell 98 Report: Predefined Types and Classes
http://haskell.org/onlinereport/basic.html
This behaviour is not what I expect after reading the description at
http://haskell.org/ghc/docs/latest/html/libraries/base/
Prelude.html#v:round
. Given that this behaviour has caused a bit o
On Mon, Oct 27, 2008 at 1:37 PM, Lennart Augustsson
<[EMAIL PROTECTED]> wrote:
> I can't remember the method being called anything.
> It was just what we were being taught. With the obvious explanation
> that .5 is right in the middle so always going one way would introduce
> a bias. This was cir
On Mon, Oct 27, 2008 at 9:48 AM, L.Guo <[EMAIL PROTECTED]> wrote:
> Hi all:
>
>
> I just read about definitions of Prelude [1], and noticing that.
>
> In 6.4.6 Coercions and Component Extraction, it discribes like this:
>
>
> "round x returns the nearest integer to x, the even integer if x is
> eq
Lennart Augustsson wrote:
I can't remember the method being called anything.
It was just what we were being taught. With the obvious explanation
that .5 is right in the middle so always going one way would introduce
a bias. This was circa 1969.
Well, I wasn't serious about the "political" exp
I can't remember the method being called anything.
It was just what we were being taught. With the obvious explanation
that .5 is right in the middle so always going one way would introduce
a bias. This was circa 1969.
On Mon, Oct 27, 2008 at 3:30 PM, Janis Voigtlaender
<[EMAIL PROTECTED]> wrot
Lennart Augustsson wrote:
It is certainly what I learnt in school. But that was another school.
Hmm, on reflection, taking Neil's explanation into account and the fact
that this rounding mode was referred to as "banker's rounding", the
point may be that it was not only another school, but anot
It is certainly what I learnt in school. But that was another school.
On Mon, Oct 27, 2008 at 12:15 PM, Janis Voigtlaender
<[EMAIL PROTECTED]> wrote:
> Henning Thielemann wrote:
>>
>> On Mon, 27 Oct 2008, L.Guo wrote:
>>
>>> I think this is unresonable. then try it in GHC 6.8.3.
>>>
>>>
>>> Prelu
2008/10/27 Janis Voigtlaender <[EMAIL PROTECTED]>:
> Janis Voigtlaender wrote:
>
>> 2.4x -> x
>
> That's supposed to be 2.4x -> 2, of course.
Ah, damn it. I was hoping for a long discussion on just what math
would look like with rounding like that ;-)
/M
--
Magnus Therning
Ketil Malde wrote:
Janis Voigtlaender <[EMAIL PROTECTED]> writes:
If you round to odd instead of round to even, then 4.5 rounds to 5,
Well, of course I did not learn to round to odd. I learned to round .5
to above, but not to do repeated rounding.
Since just about every floating point o
On Mon, 27 Oct 2008, Daniel Fischer wrote:
Am Montag, 27. Oktober 2008 11:46 schrieb Henning Thielemann:
On Mon, 27 Oct 2008, Janis Voigtlaender wrote:
Henning Thielemann wrote:
I think one reason is that repeated rounding should not be worse than
rounding in one go. Consider the rule 'use c
Am Montag, 27. Oktober 2008 11:46 schrieb Henning Thielemann:
> On Mon, 27 Oct 2008, Janis Voigtlaender wrote:
> > Henning Thielemann wrote:
> >> I think one reason is that repeated rounding should not be worse than
> >> rounding in one go. Consider the rule 'use ceiling when the first
> >> removed
Janis Voigtlaender <[EMAIL PROTECTED]> writes:
>> If you round to odd instead of round to even, then 4.5 rounds to 5,
> Well, of course I did not learn to round to odd. I learned to round .5
> to above, but not to do repeated rounding.
Since just about every floating point operation involves som
On Mon, 27 Oct 2008, Janis Voigtlaender wrote:
Henning Thielemann wrote:
I think one reason is that repeated rounding should not be worse than
rounding in one go. Consider the rule 'use ceiling when the first removed
digit is 5'. Then
0.45 - (round to one place) -> 0.5 - (round to integer)
Felipe Lessa wrote:
On Mon, Oct 27, 2008 at 8:30 AM, Janis Voigtlaender
<[EMAIL PROTECTED]> wrote:
Well, of course I did not learn to round to odd. I learned to round .5
to above, but not to do repeated rounding.
Nobody rounds in passes, of course =).
Oh, Mrs. "I forgot her name" actually
Henning Thielemann wrote:
I think one reason is that repeated rounding should not be worse than
rounding in one go. Consider the rule 'use ceiling when the first
removed digit is 5'. Then
0.45 - (round to one place) -> 0.5 - (round to integer) -> 1
But repeated rounding *is* worse than round
On Mon, Oct 27, 2008 at 8:30 AM, Janis Voigtlaender
<[EMAIL PROTECTED]> wrote:
> Well, of course I did not learn to round to odd. I learned to round .5
> to above, but not to do repeated rounding.
Nobody rounds in passes, of course =). I was talking about two
successive rounds.
> In fact, by your
Janis Voigtlaender wrote:
2.4x -> x
That's supposed to be 2.4x -> 2, of course.
--
Dr. Janis Voigtlaender
http://wwwtcs.inf.tu-dresden.de/~voigt/
mailto:[EMAIL PROTECTED]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/
Felipe Lessa wrote:
On Mon, Oct 27, 2008 at 8:15 AM, Janis Voigtlaender
<[EMAIL PROTECTED]> wrote:
That is of course true (and was the topic of heated discussion with my
fourth grade math teacher), but does not explain 2.5 -> 2.
If you round to odd instead of round to even, then 4.5 rounds t
(Janis, sorry for e-mailiing just for you on the first time.)
On Mon, Oct 27, 2008 at 8:15 AM, Janis Voigtlaender
<[EMAIL PROTECTED]> wrote:
> That is of course true (and was the topic of heated discussion with my
> fourth grade math teacher), but does not explain 2.5 -> 2.
If you round to odd in
On Mon, 27 Oct 2008, Janis Voigtlaender wrote:
Henning Thielemann wrote:
On Mon, 27 Oct 2008, L.Guo wrote:
I think this is unresonable. then try it in GHC 6.8.3.
Prelude> round 3.5
4
Prelude> round 2.5
2
Is there any explanation about that ?
It's the definition we learnt in school ..
Henning Thielemann wrote:
On Mon, 27 Oct 2008, L.Guo wrote:
I think this is unresonable. then try it in GHC 6.8.3.
Prelude> round 3.5
4
Prelude> round 2.5
2
Is there any explanation about that ?
It's the definition we learnt in school ...
Hmm, Henning, this is strange. The two of us w
> [mailto:[EMAIL PROTECTED] On Behalf Of L.Guo
> Sent: 27 October 2008 9:49 am
> To: MailList Haskell-Cafe
> Subject: [Haskell-cafe] Why 'round' does not just round numbers ?
>
> Hi all:
>
>
> I just read about definitions of Prelude [1], and noticing that.
>
On Mon, 27 Oct 2008, L.Guo wrote:
I think this is unresonable. then try it in GHC 6.8.3.
Prelude> round 3.5
4
Prelude> round 2.5
2
Is there any explanation about that ?
It's the definition we learnt in school ...
I think one reason is that repeated rounding should not be worse than
roun
Hi all:
I just read about definitions of Prelude [1], and noticing that.
In 6.4.6 Coercions and Component Extraction, it discribes like this:
"round x returns the nearest integer to x, the even integer if x is equidistant
between two integers."
I think this is unresonable. then try it in GH
37 matches
Mail list logo