Std::pow x VecOps::RVec

Hi,

Looks like the behavior or VecOps::pow is different from std::pow, wrt to decimal vs integer exponent.

{
    auto v = ROOT::RVec<double>{3.4};

    cout << ROOT::VecOps::pow(v, 2) << endl; # output: { 9 }
    cout << ROOT::VecOps::pow(v, 2.0) << endl;  # output: { 11.56 }

    cout << std::pow(3.4, 2) << endl;  # output: 11.56 
    cout << std::pow(3.4, 2.0) << endl; # output: 11.56 
}

Is this expected?

Best,
Felipe

ROOT Version: 6.32.02
Platform: linux-x86_64
Compiler: GCC13

Hi Felipe,

Thanks for the report. No, it’s not expected and an issue has been opened VecOps binary functions not using the right types · Issue #16031 · root-project/root · GitHub .
I will work on a fix in the next few days, please do not hesitate to propose one if you have some cycles to dedicated to this - it’s very simple.

Cheers,
D