From 733537865f537450ce9236a2a205c1c17245e4c3 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Tue, 16 Aug 2022 22:17:03 +0200 Subject: [PATCH] Add or op to int64 --- src/component/int64.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/component/int64.cpp b/src/component/int64.cpp index edc8e24..2dd0575 100644 --- a/src/component/int64.cpp +++ b/src/component/int64.cpp @@ -21,12 +21,12 @@ namespace int64 if (args[index].is()) { - return static_cast(args[index].as()); + return args[index].as(); } if (args[index].is()) { - return static_cast(strtoll(args[index].as(), nullptr, 10)); + return std::strtoll(args[index].as(), nullptr, 0); } throw std::runtime_error(utils::string::va("parameter %d does not have type 'string' or 'int'", index)); @@ -40,8 +40,9 @@ namespace int64 {"/", INT64_OPERATION(a / b)}, {"&", INT64_OPERATION(a & b)}, {"^", INT64_OPERATION(a ^ b)}, - {"%", INT64_OPERATION(a % b)}, + {"|", INT64_OPERATION(a | b)}, {"~", INT64_OPERATION(~a)}, + {"%", INT64_OPERATION(a % b)}, {">>", INT64_OPERATION(a >> b)}, {"<<", INT64_OPERATION(a << b)}, {"++", INT64_OPERATION(a + 1)},