Re: confusion about real vs not real zero
Sorawee Porncharoenwase <[email protected]> Fri, 19 Nov 2021 12:08:47 -0800
| Newsgroups | gmane.comp.lang.racket.user,gmane.lisp.scheme.plt |
|---|---|
| Message-ID | <CADcuegu2iBp3847QRgPcqzH4JoR=FpUXPf-n_G7xP1=Wmfs85w@mail.gmail.com> |
--00000000000069c51f05d129d866 Content-Type: text/plain; charset="UTF-8" I had this exact same question when I looked at the RacketScript issue lol. The answer is https://docs.racket-lang.org/reference/numbers.html: a complex number with an exact zero imaginary part is a real number. Since 0.0 is not exact, 0.0i is not a real number. On Fri, Nov 19, 2021 at 11:59 AM Stephen Chang <[email protected]> wrote: > In the following, why is the first considered a real number but the > second considered not real > > > (real? 0.0+0i) > #t > > (real? 0.0+0.0i) > #f > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/CAFfiA1%2BYygGrLH2rtwby8AWg7Edyvq-tzmANTNypq5Rqd-eXFw%40mail.gmail.com > . > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected] To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CADcuegu2iBp3847QRgPcqzH4JoR%3DFpUXPf-n_G7xP1%3DWmfs85w%40mail.gmail.com. --00000000000069c51f05d129d866 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div></div><div class=3D"markdown-here-wrapper" style=3D""= ><p style=3D"margin:0px 0px 1.2em!important">I had this exact same question= when I looked at the RacketScript issue lol.</p> <p style=3D"margin:0px 0px 1.2em!important">The answer is <a href=3D"https:= //docs.racket-lang.org/reference/numbers.html">https://docs.racket-lang.org= /reference/numbers.html</a>:</p> <blockquote style=3D"margin:1.2em 0px;border-left:4px solid rgb(221,221,221= );padding:0px 1em;color:rgb(119,119,119);quotes:none"> <p style=3D"margin:0px 0px 1.2em!important">a complex number with an exact = zero imaginary part is a real number.</p> </blockquote> <div title=3D"MDH:PGRpdj5JIGhhZCB0aGlzIGV4YWN0IHNhbWUgcXVlc3Rpb24gd2hlbiBJI= Gxvb2tlZCBhdCB0aGUg UmFja2V0U2NyaXB0IGlzc3VlIGxvbC48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PlRoZSBhbnN= 3 ZXIgaXMgaHR0cHM6Ly9kb2NzLnJhY2tldC1sYW5nLm9yZy9yZWZlcmVuY2UvbnVtYmVycy5odG1= s OjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+Jmd0OyBJbiB0aGUgY2FzZSBvZiBjb21wbGV4IG5= 1 bWJlcnMsIGVpdGhlciB0aGUgcmVhbCBhbmQgaW1hZ2luYXJ5IHBhcnRzCmFyZSBib3RoIGV4YWN= 0 IG9yIGluZXhhY3Qgd2l0aCB0aGUgc2FtZSBwcmVjaXNpb24sIG9yIHRoZSBudW1iZXIgaGFzCmF= u IGV4YWN0IHplcm8gcmVhbCBwYXJ0IGFuZCBhbiBpbmV4YWN0IGltYWdpbmFyeSBwYXJ0OyBhIGN= v bXBsZXgKbnVtYmVyIHdpdGggYW4gZXhhY3QgemVybyBpbWFnaW5hcnkgcGFydCBpcyBhIHJlYWw= g bnVtYmVyLjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+PC9kaXY+" style=3D"height:0;wid= th:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margi= n:0"></div></div><div>Since 0.0 is not exact, 0.0i is not a real number.<br= ></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail= _attr">On Fri, Nov 19, 2021 at 11:59 AM Stephen Chang <<a href=3D"mailto= :[email protected]">[email protected]</a>> wrote:<br></div><blockq= uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p= x solid rgb(204,204,204);padding-left:1ex">In the following, why is the fir= st considered a real number but the<br> second considered not real<br> <br> > (real? 0.0+0i)<br> #t<br> > (real? 0.0+0.0i)<br> #f<br> <br> -- <br> You received this message because you are subscribed to the Google Groups &= quot;Racket Users" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:racket-users%2Bunsubscribe-/[email protected]" targ= et=3D"_blank">racket-users+unsubscribe-/[email protected]</a>.<br> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/racket-users/CAFfiA1%2BYygGrLH2rtwby8AWg7Edyvq-tzmANTNypq5Rqd-eX= Fw%40mail.gmail.com" rel=3D"noreferrer" target=3D"_blank">https://groups.go= ogle.com/d/msgid/racket-users/CAFfiA1%2BYygGrLH2rtwby8AWg7Edyvq-tzmANTNypq5= Rqd-eXFw%40mail.gmail.com</a>.<br> </blockquote></div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;Racket Users" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:racket-users+unsubscribe-/[email protected]">racket= -users+unsubscribe-/[email protected]</a>.<br /> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/racket-users/CADcuegu2iBp3847QRgPcqzH4JoR%3DFpUXPf-n_G7xP1%3DWmf= s85w%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://group= s.google.com/d/msgid/racket-users/CADcuegu2iBp3847QRgPcqzH4JoR%3DFpUXPf-n_G= 7xP1%3DWmfs85w%40mail.gmail.com</a>.<br /> --00000000000069c51f05d129d866--