To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 161
160  |  162
Subject: 
Re: NQC 2.0 and some math questions
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Thu, 23 Sep 1999 00:03:43 GMT
Viewed: 
2314 times
  
A bug in the document.  * and / are legal for any expressions.  % is
restricted to constants.

I know the restrictions are confusing.  The problem is that the RCX
opcodes are somewhat incomplete.  Now that I think about it, I can
probably generate reasonable code for % from the primitives /, *, and -.

Dave

In article <FIGvDD.Fx7@lugnet.com>, "Dennis Clark" <dlc@verinet.com> wrote:

Dave,

You state in your documentation that * / and % can be used on constants only,
but your example has x * Y in it.  What is it that you mean?  Does this mean
that one can only do a y = 5*4 using these math routines?  Does this mean that,
for instance, I can't do a :
x = SENSOR_1
y = x/2
...
?

I have, in general, always been somewhat confused about just what math I can
use on just what kind of expression.  Can you help me out with this?

thanks,
DLC

--
reply to: dbaum at enteract dot com



Message has 1 Reply:
  Re: NQC 2.0 and some math questions
 
(...) x = y % z is equivalent to (where w is an temporary integer): w = y / z; x = y - z * w; I can't think of a useful use of % just with constants. Ciao. Marco. (25 years ago, 29-Sep-99, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  NQC 2.0 and some math questions
 
Dave, You state in your documentation that * / and % can be used on constants only, but your example has x * Y in it. What is it that you mean? Does this mean that one can only do a y = 5*4 using these math routines? Does this mean that, for (...) (25 years ago, 22-Sep-99, to lugnet.robotics.rcx.nqc)

16 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR