Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If it where me I'd store the value of PI as a structure containing an IEEE double, a decimal representation of, say, 100 digits and a pointer to a function to that can evaluate PI to an arbitrary precision.

Then I'd just just use PI as a symbol and do symbolic algebra for as long as possible. Don't evaluate it to anything until the user actually asks for a numeric representation. Once a numeric representation is required I'd pick a value from the above structure based on what has been asked for.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: