MCPcopy Create free account
hub / github.com/argotorg/solidity / roundUpFunction

Method roundUpFunction

libsolidity/codegen/YulUtilFunctions.cpp:693–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

691}
692
693std::string YulUtilFunctions::roundUpFunction()
694{
695 std::string functionName = "round_up_to_mul_of_32";
696 return m_functionCollector.createFunction(functionName, [&]() {
697 return
698 Whiskers(R"(
699 function <functionName>(value) -> result {
700 result := and(add(value, 31), not(31))
701 }
702 )")
703 ("functionName", functionName)
704 .render();
705 });
706}
707
708std::string YulUtilFunctions::divide32CeilFunction()
709{

Calls 3

WhiskersClass · 0.85
renderMethod · 0.80
createFunctionMethod · 0.45

Tested by

no test coverage detected