[prev in list] [next in list] [prev in thread] [next in thread] 

List:       flightgear-devel
Subject:    Re: [Flightgear-devel] Digits C++ helper methods
From:       Patrick Callahan <pat.callahan1 () gmail ! com>
Date:       2019-11-11 20:03:39
Message-ID: CACt=GQoxVYjR6WEQMGDTbyuMHqgv9c3FmO4-Ziz1JioQ+cSPuw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


note that digit position is counting from fright to left starting from 0
as in 10 to the 0, 10 to the 1 etc.
It's the way they explained it in second grade, or should have.

-Pat

On Mon, Nov 11, 2019 at 2:59 PM Patrick Callahan <pat.callahan1@gmail.com>
wrote:

> // I got curious about the math so tried this out on
> https://repl.it/languages/cpp
> // You're right James it is pretty simple.
>
> // Let me know if you actually want to use getDigit and setDigit for
> anything
> // and I'll write it better.
>
> // because math::pow(double, double) doesn't always and everywhere do
> integers right,
> // I looked on Stack Overflow for powers of integers with a green check
> mark.
>
> // For heated arguments about the appropriateness of myPow and alternatives
> // see stack overflow. I personally don't care because:
> // Context is everything. This is a Prototype not production code.
>
> // Actually I'd do this in a class with an instance per base, replacing
> mypow
> // in the getDigit and setDigit methods with a simple array lookup and
> using
> // a for loop instead of recursion to generate the power array.
>
> // I'd Add bounds checking exception detection and error handling if
> desired.
> // and test for negative n input values.
>
> #include <iostream>
>
> int myPow(int x, int p) {
> if (p == 0) return 1;
> if (p == 1) return x;
> return x * myPow(x, p-1);
> }
> int getDigit(int n, int powerOfBase, int base=10) {
> return(
> (n % (myPow(base,(powerOfBase+1)))
> - (powerOfBase>1 ? (n %myPow(base,(powerOfBase-1))): 0)
> )
> / myPow(base,powerOfBase));
> }
> int setDigit(int n, int powerOfBase, int v, int base=10) {
>
> return (
> (n
> - n % myPow(base,(powerOfBase+1)))
> + v* (myPow(base,powerOfBase))
> +(powerOfBase>0? n% myPow(base,(powerOfBase)): 0));
> }
>
> int main() {
> //some tests:
> std::cout << "getDigit(12345678, 0): " << getDigit(12345678, 0) << '\n';
> std::cout << "getDigit(12345678, 1): " << getDigit(12345678, 1) << '\n';
> std::cout << "getDigit(12345678, 2): " << getDigit(12345678, 2) << '\n';
> std::cout << "getDigit(12345678, 7): " << getDigit(12345678, 7) << '\n';
> std::cout << "getDigit(12345678, 8): " << getDigit(12345678, 8) << "\n\n";
> std::cout << "getDigit(0, 7): " << getDigit(0, 7) << "\n\n";;
>
> std::cout << "setDigit(12345678, 8,9): " << setDigit(12345678, 8,9) <<
> '\n';
> std::cout << "setDigit(12345678, 7,9): " << setDigit(12345678, 7,9) <<
> '\n';
> std::cout << "setDigit(12345678, 6,9): " << setDigit(12345678, 6,9) <<
> "\n\n";
> // test case superflous std::cout << setDigit(12345678, 5,9) << '\n';;
> // test case superflous std::cout << setDigit(12345678, 4,9) << '\n';;
> // test case superflous std::cout << setDigit(12345678, 3,9) << '\n';;
> std::cout << "setDigit(12345678, 2,9): " << setDigit(12345678, 2,9) <<
> '\n';
> std::cout << "setDigit(12345678, 1,9): " << setDigit(12345678, 1,9) <<
> '\n';
> std::cout << "setDigit(12345678, 0,9): " << setDigit(12345678, 0,9) <<
> "\n\n";
>
> std::cout << "setDigit(12345678, 8,0): " << setDigit(12345678, 8,0) <<
> '\n';
> std::cout << "setDigit(12345678, 7,0): " << setDigit(12345678, 7,0) <<
> '\n';
> std::cout << "setDigit(12345678, 6,0): " << setDigit(12345678, 6,0) <<
> "\n\n";
> // test case superflous std::cout << setDigit(12345678, 5,9) << '\n';;
> // test case superflous std::cout << setDigit(12345678, 4,9) << '\n';;
> // test case superflous std::cout << setDigit(12345678, 3,9) << '\n';;
> std::cout << "setDigit(12345678, 2,0): " << setDigit(12345678, 2,0) <<
> '\n';
> std::cout << "setDigit(12345678, 1,0): " << setDigit(12345678, 1,0) <<
> '\n';
> std::cout << "setDigit(12345678, 0,0): " << setDigit(12345678, 0,0) <<
> "\n\n";
> // show how things could go wrong
> std::cout << "myPow(10,32)" << myPow(10,32) << '\n';
> std::cout << "myPow(10,19)" << myPow(10,19) << '\n';
> // This next test reports the "expected" answer for the wrong reasons.
> // Actualy I expected it to cause an exception.
> // It didn't. I'm not even courious as to why. Are you?
> std::cout << "getDigit(12345678, 19): " << getDigit(12345678, 19) << '\n'
> ;;
>
> }
>
> On Sun, Nov 10, 2019 at 9:14 AM James Turner <james@flightgear.org> wrote:
>
>>
>>
>> On 8 Nov 2019, at 09:02, Nikolai Verner Christensen <
>> emptyyetfull@gmail.com> wrote:
>>
>> Feature request:
>> Any chance we can get 2 helper methods made in C++ and into Nasal API:
>>
>> int getDigit(pos, property)
>>
>> return a digit from the float/double property.
>> For example pos=2 when value of the property is 1234.567 will return 3.
>> For example pos=-1 when value of the property is 1234.567 will return 5.
>> Pos 0 return an error.
>>
>> setDigit(pos, value, property)
>>
>> sets a digit on a certain position on the value of the float/double
>> property.
>> For example pos=3 value=8 when value of the property is 1234.567 will set
>> the property to 1834.567.
>> Pos 0 return an error. So does value that is not 0-9 integer.
>>
>> The reason could use this is that rounding errors in nasal makes this a
>> hit and miss scenario, especially the digits after the decimal point. Don't
>> know why, but already at 1st or second decimal point place it can act
>> strange in nasal sometimes.
>>
>> The only thing I think we have that does this reliable is the
>> textranslate animation.
>>
>> Even a simple thing like setting a digit of a radio frequency can give
>> trouble using only int() and math.round().
>>
>> Or is there already a super reliable way to do this that I missed? For
>> example for animating some drums for digits (not smooth but stepwise) and
>> likewise having knobs change a single digit in certain place of a property.
>>
>> Or maybe binding that can increase/decrease digits in property, and
>> rotate/knob anims that can use digits of a property. That would also solve
>> it, actually might be cleaner. Especially if those would also be able to
>> manipulate 2 digits at same time. For example freq 123.25 to 123.50 to
>> 123.75 to 123.00 by stepping with 0.25, notice it did not go up to 124.00.
>>
>> Anyway is just an idea.
>>
>>
>> Quick answer, yes it's possible. The getDigit especially, but the
>> setDigit makes me nervous for a floating point number due to
>> representational accuracy concerns.
>>
>> The longer answer: for values which are ‘floating point' but need well
>> defined precision and representation, I think it's better to use an integer
>> with some well known scaling factor, and convert to floating-point when
>> displaying. The obious example being radio frequencies in Mhz - it's easier
>> to store them in Khz or even Hz as an integer, than to store in Mhz and
>> deal with floating-point digit extraction.
>>
>> Of course we can /also/ implement getDigit and setDigit as helpers for
>> integers (and indeed, I could personally save some ugly Nasal in my
>> GoFlight Transponder implementation, if I could support that for Octal as
>> well as Decimal integers…)
>>
>> At the moment I've /very/ busy with RL stuff, so rather neglecting FG
>> contributions, so alas I can't offer to code this up myself, but it's
>> pretty simple C++/C if anyone cares to have a go (and as ever, I'm happy to
>> review and give suggestions / feedback)
>>
>> Kind regards,
>> James
>>
>> _______________________________________________
>> Flightgear-devel mailing list
>> Flightgear-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>>
>

[Attachment #5 (text/html)]

<div dir="ltr">note that digit position is counting from fright to left starting from \
0   as in 10 to the 0, 10 to the 1 etc.    <div>It&#39;s the way they explained it in \
second grade, or should have.</div><div><br></div><div>-Pat</div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 11, 2019 at 2:59 PM \
Patrick Callahan &lt;<a \
href="mailto:pat.callahan1@gmail.com">pat.callahan1@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
dir="ltr"><div style="color:rgb(0,0,0);background-color:rgb(255,255,254);font-family:&quot;Droid \
Sans Mono&quot;,monospace,monospace,&quot;Droid Sans \
Fallback&quot;;font-size:14px;line-height:19px;white-space:pre-wrap"><div><span \
style="color:rgb(0,0,255)">// I got curious about the math so tried this out on \
</span><a href="https://repl.it/languages/cpp" \
target="_blank">https://repl.it/languages/cpp</a></div><div><div><span \
style="color:rgb(170,170,170)">// You&#39;re right James it is pretty \
simple.</span></div><div><span \
style="color:rgb(170,170,170)"><br></span></div><div><span \
style="color:rgb(170,170,170)">// Let me know if you actually want to use getDigit \
and setDigit for anything </span></div><div><span style="color:rgb(170,170,170)">// \
and I&#39;ll write it better.</span></div></div><div><span \
style="color:rgb(170,170,170)"><br></span></div><div><div><span \
style="color:rgb(170,170,170)">// because math::pow(double, double) doesn&#39;t \
always and everywhere do integers right, </span></div><div><span \
style="color:rgb(170,170,170)">// I looked on Stack Overflow for powers of integers \
with a green check mark. </span></div><div><span \
style="color:rgb(170,170,170)"><br></span></div><div><span \
style="color:rgb(170,170,170)">// For heated arguments about the appropriateness of \
myPow and alternatives</span></div><div><span style="color:rgb(170,170,170)">// see \
stack overflow. I personally don&#39;t care because: </span></div><div><span \
style="color:rgb(170,170,170)">// Context is everything. This is a Prototype not \
production code.</span></div><div><br></div><div><span \
style="color:rgb(170,170,170)">// Actually I&#39;d do this in a class with an \
instance per base, replacing mypow </span></div><div><span \
style="color:rgb(170,170,170)">// in the getDigit and setDigit methods with a simple \
array lookup and using </span></div><div><span style="color:rgb(170,170,170)">// a \
for loop instead of recursion to generate the power array.</span></div><div><span \
style="color:rgb(170,170,170)"><br></span></div><div><div><span \
style="color:rgb(170,170,170)">// I&#39;d </span><span \
style="color:rgb(170,170,170)">Add bounds checking exception detection and error \
handling if desired.</span></div><div><span style="color:rgb(170,170,170)">// and \
test for negative n input values.</span></div></div><div><span \
style="color:rgb(170,170,170)"><br></span></div><div></div></div><div><span \
style="color:rgb(0,0,255)">#include</span> <span \
style="color:rgb(0,0,255)">&lt;</span><span \
style="color:rgb(163,21,21)">iostream</span><span \
style="color:rgb(0,0,255)">&gt;</span></div><div><span \
style="color:rgb(170,170,170)"><br></span></div><div><span \
style="color:rgb(0,0,255)">int</span> myPow(<span \
style="color:rgb(0,0,255)">int</span> x, <span style="color:rgb(0,0,255)">int</span> \
p) {</div><div> <span style="color:rgb(0,0,255)">if</span> (p == <span \
style="color:rgb(9,136,90)">0</span>) <span style="color:rgb(0,0,255)">return</span> \
<span style="color:rgb(9,136,90)">1</span>;</div><div>  <span \
style="color:rgb(0,0,255)">if</span> (p == <span \
style="color:rgb(9,136,90)">1</span>) <span style="color:rgb(0,0,255)">return</span> \
x;</div><div>  <span style="color:rgb(0,0,255)">return</span> x * myPow(x, p-<span \
style="color:rgb(9,136,90)">1</span>);</div><div>}</div><div><span \
style="color:rgb(0,0,255)">int</span> getDigit(<span \
style="color:rgb(0,0,255)">int</span> n,  <span style="color:rgb(0,0,255)">int</span> \
powerOfBase, <span style="color:rgb(0,0,255)">int</span> base=<span \
style="color:rgb(9,136,90)">10</span>) {</div><div>   <span \
style="color:rgb(0,0,255)">return</span>(</div><div>     (n % \
(myPow(base,(powerOfBase+<span style="color:rgb(9,136,90)">1</span>))) </div><div>    \
- (powerOfBase&gt;<span style="color:rgb(9,136,90)">1</span> ? (n \
%myPow(base,(powerOfBase-<span style="color:rgb(9,136,90)">1</span>))): <span \
style="color:rgb(9,136,90)">0</span>)</div><div>      ) </div><div>      / \
myPow(base,powerOfBase));</div><div>  }</div><div><span \
style="color:rgb(0,0,255)">int</span> setDigit(<span \
style="color:rgb(0,0,255)">int</span> n, <span style="color:rgb(0,0,255)">int</span> \
powerOfBase, <span style="color:rgb(0,0,255)">int</span> v, <span \
style="color:rgb(0,0,255)">int</span> base=<span \
style="color:rgb(9,136,90)">10</span>) {</div><br><div>  <span \
style="color:rgb(0,0,255)">return</span> ( </div><div>    (n </div><div>     - n % \
myPow(base,(powerOfBase+<span style="color:rgb(9,136,90)">1</span>))) </div><div>     \
+ v* (myPow(base,powerOfBase)) </div><div>     +(powerOfBase&gt;<span \
style="color:rgb(9,136,90)">0</span>? n% myPow(base,(powerOfBase)): <span \
style="color:rgb(9,136,90)">0</span>));</div><div>}</div><div \
style="line-height:19px"><br><div><span style="color:rgb(0,0,255)">int</span> main() \
{</div><div>//some tests:  </div><div>  std::cout &lt;&lt; <span \
style="color:rgb(163,21,21)">&quot;getDigit(12345678, 0): &quot;</span> &lt;&lt; \
getDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">0</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;getDigit(12345678, 1): &quot;</span> \
&lt;&lt; getDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">1</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;getDigit(12345678, 2): &quot;</span> \
&lt;&lt; getDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">2</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;getDigit(12345678, 7): &quot;</span> \
&lt;&lt; getDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">7</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;getDigit(12345678, 8): &quot;</span> \
&lt;&lt; getDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">8</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&quot;\n\n&quot;</span>;</div><div>  </div><div>  \
std::cout &lt;&lt; <span style="color:rgb(163,21,21)">&quot;getDigit(0, 7): \
&quot;</span> &lt;&lt; getDigit(<span style="color:rgb(9,136,90)">0</span>, <span \
style="color:rgb(9,136,90)">7</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&quot;\n\n&quot;</span>;; </div><br><div>  std::cout \
&lt;&lt; <span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 8,9): \
&quot;</span> &lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, \
<span style="color:rgb(9,136,90)">8</span>,<span \
style="color:rgb(9,136,90)">9</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 7,9): &quot;</span> \
&lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">7</span>,<span style="color:rgb(9,136,90)">9</span>) \
&lt;&lt; <span style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  \
std::cout &lt;&lt; <span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 6,9): \
&quot;</span> &lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, \
<span style="color:rgb(9,136,90)">6</span>,<span \
style="color:rgb(9,136,90)">9</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&quot;\n\n&quot;</span>;</div><div><span \
style="color:rgb(170,170,170)">// test case superflous std::cout &lt;&lt; \
setDigit(12345678, 5,9) &lt;&lt; &#39;\n&#39;;;</span></div><div><span \
style="color:rgb(170,170,170)">// test case superflous std::cout &lt;&lt; \
setDigit(12345678, 4,9) &lt;&lt; &#39;\n&#39;;;</span></div><div><span \
style="color:rgb(170,170,170)">// test case superflous std::cout &lt;&lt; \
setDigit(12345678, 3,9) &lt;&lt; &#39;\n&#39;;;</span></div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 2,9): &quot;</span> \
&lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">2</span>,<span style="color:rgb(9,136,90)">9</span>) \
&lt;&lt; <span style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  \
std::cout &lt;&lt; <span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 1,9): \
&quot;</span> &lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, \
<span style="color:rgb(9,136,90)">1</span>,<span \
style="color:rgb(9,136,90)">9</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 0,9): &quot;</span> \
&lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">0</span>,<span style="color:rgb(9,136,90)">9</span>) \
&lt;&lt; <span style="color:rgb(163,21,21)">&quot;\n\n&quot;</span>;</div><br><div>  \
std::cout &lt;&lt; <span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 8,0): \
&quot;</span> &lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, \
<span style="color:rgb(9,136,90)">8</span>,<span \
style="color:rgb(9,136,90)">0</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 7,0): &quot;</span> \
&lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">7</span>,<span style="color:rgb(9,136,90)">0</span>) \
&lt;&lt; <span style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  \
std::cout &lt;&lt; <span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 6,0): \
&quot;</span> &lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, \
<span style="color:rgb(9,136,90)">6</span>,<span \
style="color:rgb(9,136,90)">0</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&quot;\n\n&quot;</span>;</div><div><span \
style="color:rgb(170,170,170)">// test case superflous std::cout &lt;&lt; \
setDigit(12345678, 5,9) &lt;&lt; &#39;\n&#39;;;</span></div><div><span \
style="color:rgb(170,170,170)">// test case superflous std::cout &lt;&lt; \
setDigit(12345678, 4,9) &lt;&lt; &#39;\n&#39;;;</span></div><div><span \
style="color:rgb(170,170,170)">// test case superflous std::cout &lt;&lt; \
setDigit(12345678, 3,9) &lt;&lt; &#39;\n&#39;;;</span></div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 2,0): &quot;</span> \
&lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">2</span>,<span style="color:rgb(9,136,90)">0</span>) \
&lt;&lt; <span style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  \
std::cout &lt;&lt; <span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 1,0): \
&quot;</span> &lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, \
<span style="color:rgb(9,136,90)">1</span>,<span \
style="color:rgb(9,136,90)">0</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;</div><div>  std::cout &lt;&lt; \
<span style="color:rgb(163,21,21)">&quot;setDigit(12345678, 0,0): &quot;</span> \
&lt;&lt; setDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">0</span>,<span style="color:rgb(9,136,90)">0</span>) \
&lt;&lt; <span style="color:rgb(163,21,21)">&quot;\n\n&quot;</span>;</div><div>  \
<span style="color:rgb(170,170,170)">// show how things could go \
wrong</span></div><div>  std::cout &lt;&lt; <span \
style="color:rgb(163,21,21)">&quot;myPow(10,32)&quot;</span> &lt;&lt; myPow(<span \
style="color:rgb(9,136,90)">10</span>,<span style="color:rgb(9,136,90)">32</span>) \
&lt;&lt; <span style="color:rgb(163,21,21)">&#39;\n&#39;</span>; </div><div>  \
std::cout &lt;&lt; <span style="color:rgb(163,21,21)">&quot;myPow(10,19)&quot;</span> \
&lt;&lt; myPow(<span style="color:rgb(9,136,90)">10</span>,<span \
style="color:rgb(9,136,90)">19</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>; </div><div>  <span \
style="color:rgb(170,170,170)">// This next test reports the &quot;expected&quot; \
answer for the wrong reasons.</span></div><div>  <span \
style="color:rgb(170,170,170)">// Actualy I expected it to cause an exception.  \
</span></div><div>  <span style="color:rgb(170,170,170)">// It didn&#39;t. I&#39;m \
not even courious as to why.  Are you?</span></div><div>  std::cout &lt;&lt; <span \
style="color:rgb(163,21,21)">&quot;getDigit(12345678, 19): &quot;</span> &lt;&lt; \
getDigit(<span style="color:rgb(9,136,90)">12345678</span>, <span \
style="color:rgb(9,136,90)">19</span>) &lt;&lt; <span \
style="color:rgb(163,21,21)">&#39;\n&#39;</span>;;</div><div><br></div><div>}</div></div></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Nov 10, 2019 at 9:14 AM \
James Turner &lt;<a href="mailto:james@flightgear.org" \
target="_blank">james@flightgear.org</a>&gt; wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><div><br><div><br><blockquote type="cite"><div>On \
8 Nov 2019, at 09:02, Nikolai Verner Christensen &lt;<a \
href="mailto:emptyyetfull@gmail.com" target="_blank">emptyyetfull@gmail.com</a>&gt; \
wrote:</div><br><div><span \
style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal \
;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transf \
orm:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">Feature \
request:</span><div style="font-family:Helvetica;font-size:12px;font-style:normal;font \
-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-in \
dent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">Any \
chance we can get 2 helper methods made in C++ and into Nasal \
API:<div><br></div><div>int getDigit(pos, property)</div><div><br></div><div>return a \
Flightgear-devel mailing list<br>
<a href="mailto:Flightgear-devel@lists.sourceforge.net" \
target="_blank">Flightgear-devel@lists.sourceforge.net</a><br> <a \
href="https://lists.sourceforge.net/lists/listinfo/flightgear-devel" rel="noreferrer" \
target="_blank">https://lists.sourceforge.net/lists/listinfo/flightgear-devel</a><br> \
</blockquote></div></div> </blockquote></div>





_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic