Trigonometric functions for `Scientific` - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.


Are there more precise versions of trigonometric functions somewhere for Scientific?

Matt Peddie

you can find bindings to MPFR's arbitrary-precision trig functions in the hmpfr package! they are not compatible with Scientific (which seems to be a roll-your-own arbitrary-precision type, so I'm not sure how widely supported I'd expect it to be . . .)

Matt Peddie

from the haddocks:

WARNING: Although Scientific has instances for all numeric classes the methods should be used with caution when applied to scientific numbers coming from untrusted sources. See the warnings of the instances belonging to Scientific.

The main application of Scientific is to be used as the target of parsing arbitrary precision numbers coming from an untrusted source.