From: Ken A. <kan...@bb...> - 2002-05-30 23:43:32
|
At 06:40 PM 5/30/2002, Nathaniel Titterton wrote: >(I've posted this on the open discussion on the sourceforge site, but read >that I should try here as well). > >I was playing with a random number generator, and was surpised to find >that in JScheme > >(/ 1 2) > >was returning 0. If jscheme doesn't have exact rational numbers (I'm >assuming it doesn't), wouldn't it make more sense to return 0.5 instead? >An implemenation is free to silently do this, it says in R4RS. We did this in an earlier version of Jscheme, then called Silk. We now adapt Java's arithmetic model so (/ 1 2) is 0 and (/ 1 2.0) is 0.5. Section 6.5.3 of R4RS gives some leeway in how numbers are implemented. >-nate > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > Nathaniel Titterton na...@so... > CITRIS PostDoc 341 Soda Hall, U.C. Berkeley, Berkeley, CA 94720 > > >_______________________________________________________________ > >Don't miss the 2002 Sprint PCS Application Developer's Conference >August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > >_______________________________________________ >Jscheme-user mailing list >Jsc...@li... >https://lists.sourceforge.net/lists/listinfo/jscheme-user |