math.functions: implement ldexp.