Figured out how to use long double...

printf("%.9Lf\n", ans)