Re: Number conversions, like floats to doubles

2003-11-08 Thread Ben Escoto
On Sun, 09 Nov 2003 01:11:09 +0100 "Marcin 'Qrczak' Kowalczyk" <[EMAIL PROTECTED]> wrote: > realToFrac :: (Fractional b, Real a) => a -> b > > It is actually defined as fromRational . toRational but GHC knows to > generate specialized code for particular types. Oops, I was looking through the pre

Re: Number conversions, like floats to doubles

2003-11-08 Thread Marcin 'Qrczak' Kowalczyk
W liście z sob, 08-11-2003, godz. 22:59, Hal Daume III pisze: > In NumExts, there's floatToDouble and doubleToFloat. It's a GHC extension, while realToFrac is Haskell 98. -- __("< Marcin Kowalczyk \__/ [EMAIL PROTECTED] ^^ http://qrnik.knm.org.pl/~qrczak/ __

Re: Number conversions, like floats to doubles

2003-11-08 Thread Marcin 'Qrczak' Kowalczyk
W liście z sob, 08-11-2003, godz. 22:41, Ben Escoto pisze: > If I want to convert a Float to a Double, should I use > > fromRational . toRational realToFrac :: (Fractional b, Real a) => a -> b It is actually defined as fromRational . toRational but GHC knows to generate specialized code for par

Re: Number conversions, like floats to doubles

2003-11-08 Thread Hal Daume III
bit weird? It took a while for > me to figure this out. I suppose they are rationals because of the > finite precision of Floats and Doubles? And similarly, (fromInteger > . toInteger) is the right way to convert the integral types? > > Why not just have a function like: > &

Number conversions, like floats to doubles

2003-11-08 Thread Ben Escoto
Quick and probably stupid question: If I want to convert a Float to a Double, should I use fromRational . toRational ? It seems to work, but isn't this a bit weird? It took a while for me to figure this out. I suppose they are rationals because of the finite precision of Floats and Do

Re: Random doubles

2001-02-14 Thread Marcin 'Qrczak' Kowalczyk
Wed, 14 Feb 2001 16:25:04 +, [EMAIL PROTECTED] <[EMAIL PROTECTED]> pisze: > Could someone please post a fragment of code that builds a list of > random Doubles using RandomIO (recursively, please, although an > example of using the interface that gives lists of random va

Re: Random doubles

2001-02-14 Thread andrew
Duh. Should have been Int -> IO [Double]. (Int being the length of the list - the list bit isn't really important, it's just getting doubles rather than ints) Andrew On Wed, Feb 14, 2001 at 04:25:04PM +, [EMAIL PROTECTED] wrote: [...] > ie Int -> IO [Rand

Random doubles

2001-02-14 Thread andrew
Hi, Could someone please post a fragment of code that builds a list of random Doubles using RandomIO (recursively, please, although an example of using the interface that gives lists of random values directly would also be interesting)? ie Int -> IO [Random] Sorry - I've searched the

RE: doubles

2000-08-11 Thread Julian Seward (Intl Vendor)
| -Original Message- | From: Jan Skibinski [mailto:[EMAIL PROTECTED]] | Sent: Thursday, August 10, 2000 3:11 PM | To: [EMAIL PROTECTED] | Cc: [EMAIL PROTECTED] | Subject: Re: doubles | | | | > | > Aha . And how many digits will GHC offer me? | | I would think that yo

Re: doubles

2000-08-10 Thread Ralf Muschall
Sebastian Schulz <[EMAIL PROTECTED]> writes: > John Peterson wrote: > > Or you can just set USE_DOUBLE_PRECISION in options.h if you want to I did that (to be precise, I had to do it every time when building hugs :-( ). pi::Double is defined by the prelude as primPiDouble, and this seems to be

Re: doubles

2000-08-10 Thread Jan Skibinski
> > Aha . And how many digits will GHC offer me? I would think that you will get the same number of digits as is available for C - unless some bits are reserved for something special, which I am not aware of. For example, in some implementations of Smalltalk the

Re: doubles

2000-08-10 Thread Sebastian Schulz
John Peterson wrote: > > Or you can just set USE_DOUBLE_PRECISION in options.h if you want to > rebuild hugs. > > John Same question as to Jan : how many significant digits will that change give me? regards seb --

Re: doubles

2000-08-10 Thread Sebastian Schulz
Jan Skibinski wrote: > > 1. What you see printed and what is used in internal >computations are two different things. In HUGS I can see 6 digits. How many are used in the intrnal computation? > 2. But Hugs'es Double is the same as Float, anyway. >This use

Re: doubles

2000-08-10 Thread John Peterson
Or you can just set USE_DOUBLE_PRECISION in options.h if you want to rebuild hugs. John

Re: doubles

2000-08-10 Thread Jan Skibinski
On Thu, 10 Aug 2000, Sebastian Schulz wrote: > Hi! > > How can I use Doubles which are more exact than six digits? > For example HUGS gives me : > > >1,23456789 > 1.23457 1. What you see printed and what is used in internal computations

doubles

2000-08-10 Thread Sebastian Schulz
Hi! How can I use Doubles which are more exact than six digits? For example HUGS gives me : >1,23456789 1.23457 I want to rotate coordinates with eulerian matrizes and I'm using the pi from the Prelude ( 6 digits). After about 1000 360°-rotations I have an error of about 0.1% ; but I

Re: Formatting doubles

2000-08-04 Thread Marcin 'Qrczak' Kowalczyk
Fri, 4 Aug 2000 09:23:00 +1000 (EST), Timothy Docker <[EMAIL PROTECTED]> pisze: > Is there a means of formatting doubles in Haskell with the precision > flexibilty of printf? The show method seems to only print the first > few decimal places, and showGFloat in the numeric modul

Formatting doubles

2000-08-03 Thread Timothy Docker
Is there a means of formatting doubles in Haskell with the precision flexibilty of printf? The show method seems to only print the first few decimal places, and showGFloat in the numeric module seems to only display a similar number For example, in hugs... import Numeric x

Re: doubles-troubles

1998-05-12 Thread Simon L Peyton Jones
> rigid and I belong to the small legion of amateurs who implemented their > own math. domain system, Rings, Fields, Modules, etc. This apparently > has no chance to be included into the Haskell standard, nobody cares. Standards develop because people who care about particular aspects of them pu