|
From: | Andreas Fischlin |
Subject: | Re: [Gm2] complex types |
Date: | Mon, 15 Dec 2008 00:52:51 +0100 |
User-agent: | Thunderbird 2.0.0.18 (Macintosh/20081105) |
Arn't C library conversion routines already longreal? MathLib0
definition looks similar to this (within RAMSES/RASS): DEFINITION FOR C MODULE CMath; PROCEDURE sqrt(x : LONGREAL) : LONGREAL; PROCEDURE sin (x : LONGREAL) : LONGREAL; PROCEDURE cos (x : LONGREAL) : LONGREAL; PROCEDURE exp (x : LONGREAL) : LONGREAL; PROCEDURE log (x : LONGREAL) : LONGREAL; PROCEDURE atan(x : LONGREAL) : LONGREAL; END CMath. Similarly I expect conversion routines to be also double precision reals, i.e. LONGREAL. Regards, Andreas Gaius Mulley wrote: Michael Lambert <address@hidden> writes:On 14 Dec 2008, at 13:16, Andreas Fischlin wrote:I opt for using the C library. Regards, AndreasYou're right. Some of us haven't tracked C closely enough to know that complex functions are in C99. MichaelHi Michael and Andreas, thankfully all the C99 intrinsic functions are also declared in gcc-4.1.2/gcc/Builtins.def [*] along with the C intrinsic functions, some of which are exposed in gcc-4.1.2/gcc/gm2/gm2-libs/Builtins.def (the gm2 definition module which defines memcpy, sinl, sinf, sin etc). I'd imagine that the primitives in C99 will be sufficient to implement the ISO complex libraries, if so then the experience should be rather similar to implementing MathLib0. (As an aside, also on of the list of things to do are the implementation of LongConv and RealConv). regards, Gaius [*] gcc-4.1.2/gcc/Builtins.def is not a M2 definition module - but a component of a C file included and macro-processed into many different types, function prototypes etc. --
________________________________________________________________________ Dr. Andreas Fischlin, Ph.D., Group Director Terrestrial Systems Ecology Institute of Integrative Biology: Ecology, Evolution, Infectious Disease Department of Environmental Sciences, ETH Zurich Address: ETH Zurich, CHN E21.1 8092 Zurich, Switzerland Phone: +41 44 633-6090 / Fax: +41 44 633-1136 http://www.sysecol.ethz.ch/Staff/af/ http://www.sysecol.ethz.ch/ _/_/_/ _/_/_/ _/ _/ _/ _/ _/ _/ Eidgenoessische Technische Hochschule Zuerich _/_/_/ _/ _/_/_/ Swiss Federal Institute of Technology Zurich _/ _/ _/ _/ Ecole polytechnique federale de Zurich _/_/_/ _/ _/ _/ Politecnico federale de Zurigo Make it as simple as possible, but distrust it! ________________________________________________________________________ |
[Prev in Thread] | Current Thread | [Next in Thread] |