[plt-scheme] mzscheme iota() results differ slightly from spec
Terrence Brannon wrote:
>>(iota 5 0 -0.1) => (0 -0.1 -0.2 -0.3 -0.4)
>>What should I have done in addition to loading the SRFI-1 library in order
>>to get the same results?
Velkommen til DrScheme, version 206p1.
Sprog: Temmelig omfattende Scheme (inklusiv MrEd og Avanceret).
> (require (lib "list.ss" "srfi" "1"))
> (iota 5 0 -0.1)
(-2.7755575615628914e-017 -0.10000000000000003 -0.20000000000000004 -0.30000000000000004 -0.4)
> (exact? -0.1)
#f
> (iota 5 0 -1/10)
(0 -1/10 -1/5 -3/10 -2/5)
> (read-decimal-as-inexact #f)
> (exact? -0.1)
#t
> (iota 5 0 -0.1)
(0 -1/10 -1/5 -3/10 -2/5)
--
Jens Axel Søgaard