Path: utzoo!attcan!uunet!midway!linac!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!snorkelwacker!ai-lab!rice-chex!bson From: bson@rice-chex.ai.mit.edu (Jan Brittenson) Newsgroups: comp.sys.handhelds Subject: Re: Two questions... Message-ID: <10986@life.ai.mit.edu> Date: 25 Sep 90 10:46:16 GMT References: <1990Sep24.183934.575@rick.cs.ubc.ca> Sender: news@ai.mit.edu Organization: nil Lines: 34 In article <1990Sep24.183934.575@rick.cs.ubc.ca> b3300876@rick.cs.ubc.ca (george kai yee chow) writes: > I was doing some geometry problem and needed to evaluate cos(pi/3) (I > know, I know, I should know it but I thought I might as well fire up > my 48 just for fun). My 48sx returned 0.4999..., not 0.5. sin(pi/6) > does return 0.5 though. Why is this? If you do pi 3 / ->NUM pi 6 / ->NUM / you get "2.00000000001", i.e. a rounding error. My guess is that there is more of a rounding error when dividing pi with the prime 3 than when dividing with the even number 6. Now, I personally would like 'cos(pi/3)' ->EVAL (as opposed to ->NUM) to pass the algebraic 'pi/3' to cos, and cos to recognize this as a know special form. (But only when the numerical-results flag is clear.) It would be nice if typing pi 3 / cos resulted in the same - the precise answer 0.5. (There are plenty of good algorithms yielding the precise answer of fractions of pi.) Hmm... this could be done with ^MATCH... Write a function cospi so that 'cospi(3)' is the precise answer of 'cos(pi/3)' and do { 'cos(pi/&piD)' 'cospi(&piD)' } ^MATCH Does anyone know how to use the third list entry, the 'conditional'? It seems you can't refer to the variables in the patterns, for instance.