This is caused by floating point arithmetic. Have a look at this
thread:
http://www.mail-archive.com/[email protected]/msg00978.html
Best,
Matt
On Fri, 30 Jan 2009, Antoine Monmayrant wrote:
> Hi everyone,
>
> I think I found something fishy with the procedure interpolate.
> It seems there is a rounding bug somewhere:
>
> meep> (interpolate 9 (list 0.5 0))
> (0.5 0.45 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0)
>
> which is what I expected. However, if I interpolate the other way round
> I get this:
>
> meep> (interpolate 9 (list 0 0.5))
> (0 0.0500000000000001 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5)
>
> which is not exactly what I wanted. I don't get why I have this
> "0.0500000000000001" instead of "0.05".
> Did anyone come across this bug?
> Any fix for it?
>
> Cheers,
>
> Antoine
>
>
>
>
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss