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:

> Printing representation of infinities and nan is a separate issue
> discussed in that thread. I will tackle it later.

I think the current most widely-compatible printing representations
are +inf, -inf, and #nan .

> For anybody wanting to flame me: I did not invent -0.0 and nan, I only
> want to support them in the way IEEE and many languages and hardware
> processors do.

I don't think that going with IEEE instead of R5RS for floating-point
behavior is flameworthy. And mathematically, there are good reasos
for it.  Indeed, R5RS is probably in need of correction on this point.

I don't think that even the IEEE float behavior is fully correct
when exact numbers are distinguished from inexact numbers; the case
in point being that the "sign" of exact zero ought to be completely
insignificant.  IMO, if you're ever doing anything that gives
different results depending on the sign of zero, and it's an
*exact* zero, NaN, or an exact result, is probably a better
answer than going either way.  I'd regard the following as
correct behavior:

(/ 1 0.0) => +inf
(/ 1 -0.0) => -inf
(/ 1 #e0.0) => #nan

(sin 0.0) => 0.0
(sin -0.0) => -0.0
(sin #e0.0 => 0

(eqv? -0.0 +0.0) => #f
(eqv? #e-0.0 #e+0.0) => #t

But I'm sure not going to flame anyone for not implementing it;
it's above and beyond both IEEE and R5RS.

I will however, cheerfully continue flaming any implementation that
allows people to add or multiply two positive integers and get a
negative result.  I don't have a problem with bitstring-addition
and bitstring-multiplication, complete with overflow and wraparound,
having bindings, but pretending  that these are the mathematical
operations known as addition and multiplication is just wrong.  Even
if you don't have bignums, it is better to signal an error, get #nan,
or get an inexact floating-point answer, than to get a blatantly
wrong answer.

Bear





Report this thread to moderator Post Follow-up to this message
Old Post
Ray Dillinger
09-23-04 02:00 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:17 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.