Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

MicroPython • Re: Creating a Native C Module demo

$
0
0
You can use a nested construct as a sort of RPN though the operator precedes the operands -

Code:

print("( 1 + 2 ) * ( 3 + 4 ) =",  stringmath.mpy(     stringmath.add("1" , "2"),     stringmath.add("3" , "4")  ))

Code:

( 1 + 2 ) * ( 3 + 4 ) = 21
I am sure an RPN handler could be constructed which would handle "1 2 + 3 4 + *", am sure I have one somewhere, but this project is more about how to create the library than the functionality.

Statistics: Posted by hippy — Tue Aug 26, 2025 4:01 pm



Viewing all articles
Browse latest Browse all 8041

Trending Articles