byteverse / scientific-notation

Numbers in Scientific Notation
Other
4 stars 2 forks source link

best way to go from RealFloat a => a -> Scientific? #2

Open chessai opened 4 years ago

chessai commented 4 years ago

e.g. Double, Float

andrewthad commented 4 years ago

At the moment, I'm actually more interested in the other direction: Scientific -> Double, etc. Simply because at the moment, this is only used for decoding JSON, not for encoding anything. Conversion to and from Double is a bit of a pain.

I'm less concerned about supporting Float. The code is probably similar, but Float is really uncommon in Haskell code.

chessai commented 4 years ago

Ok

mightybyte commented 1 year ago

To Double. This is considerably easier.

Is there any public code for this? I only see functionality for consuming Scientific as integral types.

andrewthad commented 1 year ago

I never ended up needing it, so it never got done. I'd take a PR for it though.