log-bx

koadrobot/math/log-bx

Computes logarithm of `X` to base `B`.
log-bx
@/log-bx
Computes logarithm of `X` to base `B`.
Bnumber
Xnumber
log-bx
OUT
B
X
OUTnumber
To use the node in your project you should have the koadrobot/math library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD dirtieness disable

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    Number x = getValue<input_X>(ctx);
    Number b = getValue<input_B>(ctx);
    emitValue<output_OUT>(ctx, log(x)/log(b));
}

Tabular tests

BXOUT
00NaN
11NaN
221
10101
270.3562~
-1010NaN
InfInfNaN
-InfInfNaN