Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: fred flintstone Newsgroups: comp.lang.c Subject: Re: obtaining a c value from a perl script Date: Mon, 1 May 2017 04:18:26 -0700 Lines: 63 Message-ID: References: <874lx6hqng.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net vfAHTnxFZLSKF58jZMo/NADgdwbcRGTxBy299YJQrcNa8GE/rB Cancel-Lock: sha1:oZiQSiaM0dXj9gi+RCYP1DNKoqw= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <874lx6hqng.fsf@bsb.me.uk> Xref: csiph.com comp.lang.c:108856 On 04/30/2017 08:16 AM, Ben Bacarisse wrote: > fred flintstone writes: > >> I don my asbestos suit and eye-protecting glasses* to bring up a topic >> with the gurus of c. I get a particular value from a perl script that >> I would like to see captured by C. > > What do you mean by "captured by C"? The phrase makes me think you want > to somehow pass a value from your Perl program to a C function. Even if > I'm right about this, the details of what "somehow" means for your > situation still need to be described. Sure. end of typical output: right ascension of moon 10h 3m 55s right ascension of sun 10h 4m 0s moon seconds is 36235 sun seconds is 36240 to server is 11 2457987.25953264 2457987.25774584 2457987.25848217 right ascension of moon 10h 3m 57s right ascension of sun 10h 4m 0s moon seconds is 36237 sun seconds is 36240 to server is 12 2457987.25953264 2457987.25848217 2457987.25897738 right ascension of moon 10h 3m 59s right ascension of sun 10h 4m 0s moon seconds is 36239 sun seconds is 36240 to server is 13 2457987.25953264 2457987.25897738 2457987.25921532 right ascension of moon 10h 4m 0s right ascension of sun 10h 4m 0s moon seconds is 36240 sun seconds is 36240 equal, while condition fails at julian day 2457987.25921532 equal seconds is 36240 > >> It's C right under the hood, so I >> know it can be done. The relevant value is the ultimate value for >> julian day: >> >> https://github.com/TBlazer66/ephemeris/blob/master/2.pluto.pl >> >> It's a C_double float. (terminology yikes) I'd like simply to print >> out this value in C. > > Simply is probably the wrong word here. Printing floating point values > in C is indeed simple, but nothing you have posted suggests you have the > right floating point value in C. > > > Let's say I had a value in perl that I knew was a c double. It's a premise. If the only output of this script were: say "$equal"; , then I think there is a wide road for C interop. -- fred