add a helper function output_double_binary to print double as an expression with python-like grammar N*2**M
add a helper function output_double_binary to print double as an expression with python-like grammar N*2**M
change format a little bit of  output_double_binary
also handle Inf, 0, NaNs