Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vmod/vmod_std.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,11 @@ vmod_timed_call(VRT_CTX, VCL_SUB sub)
VRT_call(ctx, sub);
return (VTIM_mono() - b);
}

VCL_REAL v_matchproto_(td_std_pow)
vmod_pow(VRT_CTX, VCL_REAL base, VCL_REAL power)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);

return (pow(base, power));
}
8 changes: 8 additions & 0 deletions vmod/vmod_std.vcc
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,14 @@ Example::

set req.http.real = std.time2real(now, 1.0);

$Function REAL pow(REAL base, REAL power)

Calculates the power raised to the base number.

Example::

set req.http.x-p = std.pow(2.0, 2.0);

SEE ALSO
========

Expand Down