<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16434"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=154355711-01102011>You wrote earlier:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=154355711-01102011>Still seems weird and
inconvenient for round to give you back an inexact integer rather than an exact
one</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=154355711-01102011><FONT color=#0000ff>I
gave my example to show that it is not weird and that in my opinion it is
convenient.. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=154355711-01102011><FONT color=#0000ff>The
absolute error of</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=154355711-01102011><FONT
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=154355711-01102011><FONT color=#0000ff
size=2 face=Arial>(round (/ 1.0 1.1e-200)))<BR></FONT></SPAN></DIV>
<DIV><SPAN class=154355711-01102011><FONT color=#0000ff size=2 face=Arial>is of
the order (expt 10 183) (with 32 bit Racket)</FONT></SPAN></DIV>
<DIV><SPAN class=154355711-01102011><FONT color=#0000ff size=2
face=Arial>Although the relative error is of the order of (expt 10
-17)</FONT></SPAN></DIV>
<DIV><SPAN class=154355711-01102011><FONT color=#0000ff size=2 face=Arial>it
would be nonsense to classify the result as exact.</FONT></SPAN></DIV>
<DIV><SPAN class=154355711-01102011><FONT color=#0000ff size=2 face=Arial>I do
agree with you for the special cases.</FONT></SPAN></DIV>
<DIV><SPAN class=154355711-01102011><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=154355711-01102011><FONT color=#0000ff size=2
face=Arial>Jos</DIV>
<DIV dir=ltr align=left><BR></FONT></SPAN> </DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Doug Williams
[mailto:m.douglas.williams@gmail.com] <BR><B>Sent:</B> sábado, 01 de octubre de
2011 0:20<BR><B>To:</B> Jos Koot<BR><B>Cc:</B> Mark Engelberg; Stephen Bloch;
users@racket-lang.org<BR><B>Subject:</B> Re: [racket] Question about
round<BR></FONT><BR></DIV>
<DIV></DIV>I was only advocating it in the case of infinities. The R(5,6)RS
documentation for min/max says: "If any argument is inexact, then the result is
also inexact (unless the procedure can prove that the inaccuracy is not large
enough to affect the result, which is possible only in unusual
implementations)." I would claim that the inaccuracy in the min/max in this case
is finite and not large compared to infinity, so the result is not
affected.<BR><BR>I seem to remember that PLT Scheme used to handle infinities as
exact quantities. Can anyone confirm or deny that? <BR><BR>Doug<BR><BR>
<DIV class=gmail_quote>On Fri, Sep 30, 2011 at 3:42 PM, Jos Koot <SPAN
dir=ltr><<A
href="mailto:jos.koot@telefonica.net">jos.koot@telefonica.net</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><U></U>
<DIV>
<DIV class=im>
<DIV dir=ltr align=left><SPAN><FONT color=#0000ff size=2 face="Courier New">I
already wrote:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN><SPAN lang=ES-MODERN><FONT color=#0000ff size=2
face=Arial></FONT></SPAN></SPAN> </DIV>
<DIV dir=ltr><FONT color=#0000ff size=2 face="Courier New">#lang
racket</FONT></DIV>
<DIV dir=ltr><FONT color=#0000ff size=2 face="Courier New">(=
(inexact->exact (round (/ 1.0 1.1e-200)))</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New"><FONT color=#0000ff><FONT
size=2><SPAN> </SPAN>(round (/ #e1.0 #e1.1e-200))) ; ->
#f</FONT></FONT></FONT></DIV>
<DIV dir=ltr><FONT color=#0000ff size=2
face="Courier New"></FONT> </DIV></DIV>
<DIV dir=ltr><SPAN><FONT color=#0000ff size=2 face="Courier New">A computation
that ends up with an integer may introduce a computational
error when during the computation inexact numbers have been used.
Inexactness should remain contaguous.</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN><FONT color=#0000ff size=2
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN><FONT color=#0000ff size=2 face="Courier New">I do admit
that (min 0 +inf.0) can retuirn an exact integer.</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN><FONT color=#0000ff size=2
face="Courier New"></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN><FONT color=#0000ff size=2
face="Courier New">Jos</FONT></SPAN></DIV>
<DIV dir=ltr align=left> </DIV><FONT color=#0000ff size=2
face="Courier New"></FONT><BR>
<DIV dir=ltr lang=en-us align=left>
<HR>
<FONT size=2 face=Tahoma>
<DIV class=im><B>From:</B> <A href="mailto:users-bounces@racket-lang.org"
target=_blank>users-bounces@racket-lang.org</A> [mailto:<A
href="mailto:users-bounces@racket-lang.org"
target=_blank>users-bounces@racket-lang.org</A>] <B>On Behalf Of </B>Mark
Engelberg<BR></DIV><B>Sent:</B> viernes, 30 de septiembre de 2011
18:18<BR><B>To:</B> Stephen Bloch<BR><B>Cc:</B> <A
href="mailto:users@racket-lang.org"
target=_blank>users@racket-lang.org</A><BR><B>Subject:</B> Re: [racket]
Question about round<BR></FONT><BR></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV></DIV>I'm amazed at how long I've gone with the misconception
that:<BR>Exact Numbers = Integers union Rationals<BR>Inexact Numbers =
Floating Point numbers<BR>(Frankly, I never really thought much about what
infinities were. I assumed they were a separate, distinct
type).<BR><BR>When I saw in the docs for round that it returns an integer, and
I was getting an inexact number, I was sure it was a mistake. Thanks for
helping me straighten out my thinking on this. I can see how you might
want to test an inexaxct number for whether it is the floating point
approximation of an "integer", so that makes sense. Still seems weird
and inconvenient for round to give you back an inexact integer rather than an
exact one, but I can see now how this behavior matches the
standard.<BR><BR>Thanks,<BR><BR>Mark<BR><BR></DIV></DIV></DIV><BR>_________________________________________________<BR> For
list-related administrative tasks:<BR> <A
href="http://lists.racket-lang.org/listinfo/users"
target=_blank>http://lists.racket-lang.org/listinfo/users</A><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>