Finish porting libbase math to newer builtin spec