I've noticed something interesting about the `log' function. Check out this interaction:

> (real->double-flonum #e1e400)
+inf.0
> (log #e1e400)
921.0340371976183

It's obviously not just converting to flonum first; it's likely doing some kind of argument reduction internally.

`sqrt' operates on superfloat numbers when they're perfect squares, and `sin' doesn't at all:

> (sqrt #e1e400)
[1e200 written out]
> (sqrt #e1e401)
+inf.0
> (sin #e1e400)
+nan.0

I have two questions:

1. I think I have the Mad Skillz to make these work by wrapping the primitives with something that does argument reduction. Should I? (It should be especially interesting to do `sin', requiring an arbitrary-precision `pi' constant. Woo!)

2. Under what circumstances should sublinear `math' library functions do this? All of them?

Neil ⊥
_________________________
 Racket Developers list:
 http://lists.racket-lang.org/dev

Reply via email to