Re: [LAU] OT(ish): Strange coding problem (audio related)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: linux-audio-user <linux-audio-user@...>
Date: Friday, January 28, 2011 - 11:29 am

Excerpts from Gabriel M. Beddingfield's message of 2011-01-28 04:00:51 +0100:

Interesting.. would you mind explaining how this can be?
How can 11-11 yield 4.80518e-16?

Do I understand it correctly: log(2048)/log(2.0) yields a float and for comparison k is
implicitly cast to float as well. Why does the output of your
test-Program still show "k = 11"?

And why does it only happen on some machines? I'd play with it and try
to figure out what's going on and how this kind of problem can be
avoided, but the error doesn't appear here.

Here's the output on my machine:

k = 0 ITERS = 11 diff = 11
k = 1 ITERS = 11 diff = 10
k = 2 ITERS = 11 diff = 9
k = 3 ITERS = 11 diff = 8
k = 4 ITERS = 11 diff = 7
k = 5 ITERS = 11 diff = 6
k = 6 ITERS = 11 diff = 5
k = 7 ITERS = 11 diff = 4
k = 8 ITERS = 11 diff = 3
k = 9 ITERS = 11 diff = 2
k = 10 ITERS = 11 diff = 1

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] OT(ish): Strange coding problem (audio related), James Stone, (Fri Jan 28, 12:35 am)
Re: [LAU] OT(ish): Strange coding problem (audio related), Gabriel M. Beddingfield, (Fri Jan 28, 3:01 am)
Re: [LAU] OT(ish): Strange coding problem (audio related), Philipp Überbacher, (Fri Jan 28, 11:29 am)
Re: [LAU] OT(ish): Strange coding problem (audio related), Peter Nelson, (Fri Jan 28, 12:04 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Philipp Überbacher, (Fri Jan 28, 1:02 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Philipp Überbacher, (Sat Jan 29, 11:07 am)
Re: [LAU] OT(ish): Strange coding problem (audio related), Peter Nelson, (Sat Jan 29, 12:47 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Philipp Überbacher, (Sun Jan 30, 1:29 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Philipp Überbacher, (Sun Feb 13, 3:30 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Philipp Überbacher, (Sat Jan 29, 12:22 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Peter Nelson, (Sat Jan 29, 12:54 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Philipp Überbacher, (Sun Jan 30, 1:46 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Gabriel M. Beddingfield, (Fri Jan 28, 2:40 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Gabriel Beddingfield, (Fri Jan 28, 12:28 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Peter Nelson, (Fri Jan 28, 12:41 pm)
Re: [LAU] OT(ish): Strange coding problem (audio related), Gabriel M. Beddingfield, (Fri Jan 28, 2:31 pm)