From: Peter Bex <[email protected]> Subject: Re: [Chicken-hackers] [PATCH] Re: make check failing Date: Sat, 5 Jan 2013 00:03:57 +0100
> On Fri, Jan 04, 2013 at 11:58:33PM +0100, Peter Bex wrote: >> On Fri, Jan 04, 2013 at 11:39:51PM +0100, Felix wrote: >> > > >> > > I'm thinking bugs like indexing a pixel or a database record at position >> > > 1.5 due to a mistaken offset calculation. I've made mistakes like that >> > > in the past and would like those to be caught early. I know we can >> > > always add additional checks in wrapper code around the call, but I think >> > > that if I'm asking for an integer it makes sense if it complains when >> > > passed some fractional value. >> > >> > What happens when some integer computation involving fixnums ends up with >> > something like 123.0000000001 ? Must I always wrap my arguments in "round" >> > ? >> >> Actually, if you want to write portable code you must, and you must also >> wrap it in inexact->exact. > > Sorry, didn't read your message properly. If a calculation involving > only fixnums ends up as 123.0000000001, I think you have worse problems > than type mismatches. In that case you really should be using the > numbers egg, or reorder the calculation to produce smaller results. I meant "involving flonums". Sorry. cheers, felix _______________________________________________ Chicken-hackers mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-hackers
