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

Scheme is the same. If you type a number with a dot in it, you'll get an "inexact" number, which is floating point. If you prefix it with #e, you'll get an exact representation of the entered number (so, e.g. #e0.1 gives you 1/10)

The output of inexact numbers is typically truncated. In CHICKEN, you can use flonum-print-precision to tweak that. In an example, straight from the manual:

    > (flonum-print-precision 17)
    > 0.1
    0.10000000000000001


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

Search: