Hi, Kurt.

As far as I can judge, You are mistaken. The Haskell function decodeFloat applied to a real floating-point number returns the significand expressed as an Integer and an appropriately scaled exponent (an Int). I.e. if decodeFloat x return (m,n), then x = m*2^n.

For example, decodeFloat 67.3425 gives (4738807154784338,-46).

By on 4/27/2008 10:20 AM ()

(red face) you're right...thanks for the heads up!

By on 4/28/2008 1:50 AM ()

What about something like:
let decodeFloat x =
let fx = floor x
fx, x - fx

By on 4/25/2008 10:51 AM ()

Your decodeFlaot 12.45 = (12, 0.45). I want (12, 45)

I guess I should write x to string, split it and parse both parts again as int. I just hoped I overlooked some obvious solution.

Kurt

By on 4/25/2008 12:59 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper