[math] fix compilation with g++ (for nps)

this solution is not really nice and consume a bit more space, if
anyone have a better idea...