comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Friday Afternoon Puzzler
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Friday Afternoon Puzzler [message #66834 is a reply to message #66832] Fri, 12 June 2009 14:09 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.249c6dccba4246d098a6e1@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:

> Folks,
>
> If you've already had a beer, you may want to work
> on this one. Should we be concerned? Or is this just
> one more example for the Sky is Falling article?
> I've voiced my opinion, but it didn't satisfy the
> complainant. What say you?
>
> curly=[-1.912,-1.852,-1.386,-0.818,-0.343,-0.343,-1.233]
> larry=[-1.912,-1.852,-1.386,-0.818,-0.343,-0.343,-1.233]
> curly = curly*!PI/180.
> larry *= !PI/180.
> diff=curly-larry
> print,diff
>
> Why aren't the first set of differences (where the assignment
> is made with the *= operator) *exactly* zero?
>
> Cheers,
>
> David

My guess is that the compiler/interpreter does the multiplication and
division operations in a different order in the two statements in the
first case. The other two cases are syntactically identical, so the
operations should be carried out in the same order.

*Why* the operations are done in a different order is the meta-
question.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Checking version number
Next Topic: 4 byte integers

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 09:11:59 PDT 2025

Total time taken to generate the page: 0.40139 seconds