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
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/
__
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
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:
>
&
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
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
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
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
| -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
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
>
> 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
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
--
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
Or you can just set USE_DOUBLE_PRECISION in options.h if you want to
rebuild hugs.
John
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
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
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
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
> 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
19 matches
Mail list logo