Looking at the documentation, there is isnum() and isint(), and they both see 0xdb as true. Of course it is. But, how to tell 0xdb apart from 219 as a one-liner? What I'd like is to treat 0,2,5,6.5 as 1 while 0b/0x(num) as 0. Maybe decimals isn't needed here too.
EDIT:
This work. Had to put in escapes, and it took me a while to get there.
root@localhost:~# gmic eval same\(isint\(\'0123456789\'\,_\'0\',_\'9\'\),1\) ps
[gmic]./ Start G'MIC interpreter (v.3.5.5).
[gmic]./ Evaluate expression 'same(isint('0123456789',_'0',_'9'),1)' and assign it to status.
1
[gmic]./ End G'MIC interpreter.
Looking at the documentation, there is isnum() and isint(), and they both see 0xdb as true. Of course it is. But, how to tell 0xdb apart from 219 as a one-liner? What I'd like is to treat 0,2,5,6.5 as 1 while 0b/0x(num) as 0. Maybe decimals isn't needed here too.
EDIT:
This work. Had to put in escapes, and it took me a while to get there.