Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: R5RS numbers
Marcin 'Qrczak' Kowalczyk wrote:
 
>
> 5854679515581645/4503599627370496

Whoa, hold the phone.  This is a reasonably close approximation
but I got two questions -- where's the second argument to
inexact->exact,  and why is this an approximation?  Shouldn't it
just be 13/10?  You're supposed to get the simplest rational
that's within range of the number, and 13/10 is within range
(I guarantee, even with the range argument missing) and way
simpler than 5854679515581645/4503599627370496.
 

> 1
 

> 1+0.0i

This is a slightly odd result.  It's clearly an inexact number,
but why isn't it written back by the interpreter as 1.0+0.0i ?

 

> (2.0 2)

This however, is a clear error.  You can't take the real part
of an inexact complex number and get an exact real number.
 
>
> #t
>
> The last case is silly, because the numbers are not equivalent.

Yes, they absolutely are; they are inexact complex numbers having
the same value. Your implementation here is doing exactly the
right thing, both mathematically and to the letter and spirit of
R5RS.

Bear


Report this thread to moderator Post Follow-up to this message
Old Post
Ray Dillinger
09-22-04 08:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Scheme archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:14 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.