Skip to content

Commit

Permalink
Merge pull request #45 from diamante0018/main
Browse files Browse the repository at this point in the history
Add missing or operator for int64
  • Loading branch information
alicealys authored Aug 16, 2022
2 parents b81928d + 7335378 commit dbc3470
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/component/int64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ namespace int64

if (args[index].is<int>())
{
return static_cast<int64_t>(args[index].as<int>());
return args[index].as<int>();
}

if (args[index].is<const char*>())
{
return static_cast<int64_t>(strtoll(args[index].as<const char*>(), nullptr, 10));
return std::strtoll(args[index].as<const char*>(), nullptr, 0);
}

throw std::runtime_error(utils::string::va("parameter %d does not have type 'string' or 'int'", index));
Expand All @@ -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)},
Expand Down

0 comments on commit dbc3470

Please sign in to comment.