mirror of
https://codeberg.org/scip/rpnc.git
synced 2025-12-18 21:11:02 +01:00
added more byte converters
This commit is contained in:
24
funcs.go
24
funcs.go
@@ -437,6 +437,30 @@ func DefineFunctions() Funcalls {
|
||||
},
|
||||
1),
|
||||
|
||||
"bytes-to-kilobytes": NewFuncall(
|
||||
func(arg Numbers) Result {
|
||||
return NewResult(arg[0]/1024, nil)
|
||||
},
|
||||
1),
|
||||
|
||||
"bytes-to-megabytes": NewFuncall(
|
||||
func(arg Numbers) Result {
|
||||
return NewResult(arg[0]/1024/1024, nil)
|
||||
},
|
||||
1),
|
||||
|
||||
"bytes-to-gigabytes": NewFuncall(
|
||||
func(arg Numbers) Result {
|
||||
return NewResult(arg[0]/1024/1024/1024, nil)
|
||||
},
|
||||
1),
|
||||
|
||||
"bytes-to-terabytes": NewFuncall(
|
||||
func(arg Numbers) Result {
|
||||
return NewResult(arg[0]/1024/1024/1024/1024, nil)
|
||||
},
|
||||
1),
|
||||
|
||||
"or": NewFuncall(
|
||||
func(arg Numbers) Result {
|
||||
return NewResult(float64(int(arg[0])|int(arg[1])), nil)
|
||||
|
||||
Reference in New Issue
Block a user