- converters
- bitwise operators
- hex input and output support
This commit is contained in:
2023-11-13 11:02:38 +01:00
parent 127483eea1
commit ad3a49715c
5 changed files with 136 additions and 2 deletions

View File

@@ -117,6 +117,15 @@ func (c *Calc) SetCommands() {
}
},
),
"hex": NewCommand(
"show last stack item in hex form (converted to int)",
func(c *Calc) {
if c.stack.Len() > 0 {
fmt.Printf("0x%x\n", int(c.stack.Last()[0]))
}
},
),
}
c.StackCommands = Commands{