 | | Floating Point Arithmetic (Re: NQC with C++ header file)
|
|
Speaking of FP, leJOS supports floating point arithmetic, and it now has a java.lang.Math class with pow, sqrt, sin, cos, tan and atan. Brian Bagnall is working on atan2, asin, acos, etc. It's getting more and more complete. We're currently (...) (26 years ago, 25-Oct-00, to lugnet.robotics)
|
| |
 | | RE: NQC with C++ header file
|
|
(...) Well, not exactly. I guess I should elaborate. These rations are commonly used for scaling results. Of course if you do the division in integer you get 3, but what if you had an intermediate result that was 32 bits long. That's how Forth (...) (26 years ago, 25-Oct-00, to lugnet.robotics)
|
| |
 | | Electrical Data Link between 2 RCXs
|
|
The following describes an "electrical data link" (one direction) between 2 RCXs (see also my subject "Connecting 2 RCXs"). The task is that one RCX sends a number (e.g. a status) to another RCX via a cable. The IR link cannot be used because they (...) (26 years ago, 25-Oct-00, to lugnet.robotics.rcx.nqc)
|
| |
 | | RE: NQC with C++ header file
|
|
Absolutely! You'd be amazed at what can be done with 16 bit integer arithmetic if you operate at some suitable scale factor, depending upon the requirements - x10, x100, x16, x256. It depends on the ease with which you can shift and/or divide. As (...) (26 years ago, 25-Oct-00, to lugnet.robotics)
|
| |
 | | RE: NQC with C++ header file
|
|
(...) Bah! We don't need no stinkin floating point. Here are a few approximations to real and transcendental numbers that you can make by dividing signed integers - the error is gennerally less that 1 in 1,000,000 pi 355 /113 sqrt(2) 19601 / 13860 e (...) (26 years ago, 25-Oct-00, to lugnet.robotics)
|