Re: [pure-lang-users] complex 0
Status: Beta
Brought to you by:
agraef
|
From: Eddie R. <er...@bm...> - 2008-09-09 13:27:59
|
On Tue, 2008-09-09 at 13:00 +0200, Albert Graef wrote: > Yes, you are, I'm afraid. :) The Scheme way doesn't make much sense > there because log is always an inexact operation. What about ln 1? Scheme has a different philosophy from Pure: all operations *try* to return an exact value if the operation's argument(s) are exact. (log 1) => 0 ; an exact 0 not an approximated 0.0 (sin 0) => 0 (cos 0) => 1 ; an exact 1 (sqrt 4) => 2 ; an exact 2 (sqrt -4) => 0+2i ; no approximations on the img part. (/ 1 3) => 1/3 (expt 16 1/2) => 4 (expt 8 1/3) => 2.0 ; uh oh? My Casio gives the exact value of 2 here. What does you HP give? I'm not disagreeing with your reasoning that Pure should promote its argument(s) to inexact values like C does though. I think I've totally chased the rabbit away from my original question which was about consistency for which you found the answer in a later post. My arm is getting tired of flogging. I'll shut up and go back to work now ;-) e.r. |