Rev 8535 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8535 | superturbo | 1 | /* Copyright (C) 2019-2021 Logaev Maxim (turbocat2001), GPLv3 */ |
2 | |||
3 | #include "tinypy.h" |
||
4 | |||
5 | #define GET_NUM_ARG() TP_TYPE(TP_NUMBER).number.val |
||
6 | #define GET_STR_ARG() TP_TYPE(TP_STRING).string.val |
||
7 | |||
8 | static tp_obj _add(TP){ |
||
9 | unsigned num1 = (unsigned)GET_NUM_ARG(); |
||
10 | unsigned num2 = (unsigned)GET_NUM_ARG(); |
||
11 | return tp_number(num1 | num2); |
||
12 | } |
||
13 | |||
8578 | superturbo | 14 | static tp_obj _mul(TP){ |
15 | unsigned num1 = (unsigned)GET_NUM_ARG(); |
||
16 | unsigned num2 = (unsigned)GET_NUM_ARG(); |
||
17 | return tp_number(num1 & num2); |
||
18 | |||
19 | } |
||
20 |