[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: implementation categories, exact rationals

This page is part of the web mail archives of SRFI 77 from before July 7th, 2015. The new archives for SRFI 77 contain all messages, not just those from before July 7th, 2015.



Aubrey Jaffer scripsit:

>  | > A case could be made if (expt -26. 1/3) returned -2.9624960684073702;
>  | > but I know of no Scheme implementation that does so.
>  | 
>  | Why would that be desirable?
> 
> Because it is the cube root of -26.  A better example is:
> (expt -27 1/3) ==> -3

-3 is *a* cube root of 27, but not the *principal* cube root.  Consider the
third part of Quux's Tripartite Acceptance Test:

1) the value of T is T (or in Scheme, of #t is #t)

2) the value of (/ (factorial 1000) (factorial 999)) is 1000 (given the
usual iterative definition of factorial)

3) the value of (atanh -2) is a complex number (if it is the right complex
number, approximately -0.54930615+1.5707964i, so much the better)

-- 
Andrew Watt on Microsoft:                       John Cowan
Never in the field of human  computing          jcowan@xxxxxxxxxxxxxxxxx
has so much been paid by so many                http://www.ccil.org/~cowan
to so few! (pace Winston Churchill)             http://www.reutershealth.com