Hi,
I need to make the following structure into
an instance of Storable:
struct {
double w[2];
}
Can I assume that its function 'alignment' should
return the same as alignment (1::CDouble)? Or
should it be 2 * alignment (1::CDouble)?
(I've read the wikipedia article about memory alignment,
Hello Maurício,
Saturday, November 15, 2008, 11:29:23 PM, you wrote:
struct {
double w[2];
}
Can I assume that its function 'alignment' should
return the same as alignment (1::CDouble)? Or
should it be 2 * alignment (1::CDouble)?
secind - definitely not. first - probably yes
--
If you are using hsc2hs (if you are using Cabal this is easy; just
rename the file to *.hsc and Cabal will take care of the rest), then
there is a macro for making this easier and so you don't have to think
about it.
First, place the following at the top of your source file:
#let alignment t =
On 6 Jan 2005, at 01:37, Maurício wrote:
import Complex;
complex_root :: (Float, Float, Float) - (Complex Float, Complex Float)
complex_root (a,b,c) = (x1,x2) where {
delta = b * b - 4 * a * c :: Float;
sqr_delta = if delta = 0 then (sqrt delta) :+ 0 else 0 :+ (sqrt
delta) :: (Complex Float);
Maurício [EMAIL PROTECTED] writes:
complex_root :: (Float, Float, Float) - (Complex Float, Complex Float)
complex_root (a,b,c) = (x1,x2) where {
delta = b * b - 4 * a * c :: Float;
sqr_delta = if delta = 0 then (sqrt delta) :+ 0 else 0 :+
(sqrt delta) :: (Complex
Hi,
When compiling this:
import Complex;
complex_root :: (Float, Float, Float) - (Complex Float, Complex Float)
complex_root (a,b,c) = (x1,x2) where {
delta = b * b - 4 * a * c :: Float;
sqr_delta = if delta = 0 then (sqrt delta) :+ 0 else 0 :+ (sqrt delta)
:: (Complex Float);