Re: Inline C

2008-05-30 Thread sisyphus
Chas recommended, it's a good idea to always include the following at the beginning of your Inline::C scripts: use Inline C => Config => BUILD_NOISY => 1; Then (and only then) will you get to see helpful output (that Inline, by default, conceals) as a script *successfully* buil

Re: Inline C

2008-05-29 Thread Chas. Owens
On Thu, May 29, 2008 at 12:53 PM, Rajnikant <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I have a static library main.a and I want to call one function of this > library from Perl code. > I have configured Inline params link (LIBS,INC etc) and my perl script > compiles fine. > > But when I call

Inline C

2008-05-29 Thread Rajnikant
Hello everyone, I have a static library main.a and I want to call one function of this library from Perl code. I have configured Inline params link (LIBS,INC etc) and my perl script compiles fine. But when I call library function from perl script, it says 'Undefined subroutine func_name'. Do yo

Re: How can I get Inline::C to deal with big number?

2005-03-28 Thread John W. Krahn
Steven Schubiger wrote: > On 26 Mar, Edward Wijaya wrote: > >>What could be the problem? >>Is there a way to solve it > > I assume, the typedef doesn't value the "hooked" malloc, thus, > I recommend: > > long double *big_double; > big_double = (long double *) malloc(2*sizeof(long double));

Re: How can I get Inline::C to deal with big number?

2005-03-28 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: > What could be the problem? > Is there a way to solve it I assume, the typedef doesn't value the "hooked" malloc, thus, I recommend: long double *big_double; big_double = (long double *) malloc(2*sizeof(long double)); -- The trouble with having an open mind, of

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Dear Steven, Sorry, don't mean to nitpick. On Sat, 26 Mar 2005 23:09:26 +0800, Steven Schubiger <[EMAIL PROTECTED]> wrote: On 26 Mar, Edward Wijaya wrote: It's fine, as it is. Typedefs most often reside in header files, although, they can be used in the main file without suffer. As per your sug

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: > Sorry my C is barely Novice. > Where can I put this snippet in my C subroutine? It's fine, as it is. Typedefs most often reside in header files, although, they can be used in the main file without suffer. If you ever should get bored, read the Perl Sources. --

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
On Sat, 26 Mar 2005 22:31:52 +0800, Steven Schubiger <[EMAIL PROTECTED]> wrote: typedef (malloc(2*sizeof(long double))) Big_Double; Big_Double var; Sorry my C is barely Novice. Where can I put this snippet in my C subroutine? like this: [snip code] __END__ __C__ typedef (malloc(2*sizeof(long do

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> printf("%i\n", sizeof(long double)); > > It gives: > 12 Fine, it was even 2 Bytes bigger than excepted. typedef (malloc(2*sizeof(long double))) Big_Double; Big_Double var; var should measure 24 bytes in size, which should suffice; if not, increment the factor

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
> On 26 Mar, Edward Wijaya wrote: >> Try "long double" instead, which gives you 10 Bytes and >> the format char %Lf. > Still wont' do. It still return 'inf' for N>500 Another solution would be, dynamically allocating memory: long double var; var = (long double *) malloc(2*sizeof(long double)

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> Try "long double" instead, which gives you 10 Bytes and >> the format char %Lf. > Still wont' do. It still return 'inf' for N>500 What does printf("%i\n", sizeof(long double)); tell you? The byte sizes of variable types can vary from platform to platform. --

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Hi Steven, On Sat, 26 Mar 2005 22:08:44 +0800, Steven Schubiger <[EMAIL PROTECTED]> wrote: Try "long double" instead, which gives you 10 Bytes and the format char %Lf. Still wont' do. It still return 'inf' for N>500 -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> Change every occurence of the word "float" , in your script, >> to "double". > > It worked, but still limited. It overflowed when N>500. > Most of the value of N, I use are around 1000-2000. > > Any other possibility? Try "long double" instead, which gives you

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Hi Zentara, Thanks for the reply. On Sat, 26 Mar 2005 21:35:17 +0800, zentara <[EMAIL PROTECTED]> wrote: Change every occurence of the word "float" , in your script, to "double". It worked, but still limited. It overflowed when N>500. Most of the value of N, I use are around 1000-2000. Any other p

How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Hi, I have the following code that uses Inline::C to compute factorial. The problem is that whenever I use large N (>30) it began to return "INF". I thougtht my C implementation already cater large number by using "float"? Additionally I have already added Math::Pari as

Re: Inline::C

2002-07-17 Thread Chas Owens
On Wed, 2002-07-17 at 19:02, drieux wrote: > > On Wednesday, July 17, 2002, at 03:21 , Chas Owens wrote: > [..] > > however Inline::C is not always available, > [..] > > http://search.cpan.org/search?dist=Inline > > yes from the Readme it notes: > >

Inline::C

2002-07-17 Thread drieux
On Wednesday, July 17, 2002, at 03:21 , Chas Owens wrote: [..] > however Inline::C is not always available, [..] http://search.cpan.org/search?dist=Inline yes from the Readme it notes: "Inline saves you from the hassle of having to write and compile your own glue code using fa

Accessing scratchpad variables with Inline::C

2001-12-28 Thread Curtis Poe
Okay, this is not exactly a beginner's question, but I can't seem to find an answer to this anywhere. Does anyone have any samples of XS, SWIG, or Inline::C code (preferably the latter) that accesses scratchpad variables? I've looked and can't seem to find any. Readi