Sponsored Content
Top Forums UNIX for Advanced & Expert Users Help please...output problems with printf. Post 302248811 by geekosaur on Sunday 19th of October 2008 07:30:06 PM
Old 10-19-2008
You are using the %f format to scanf, but storing to an (int). (%f requires a (double) to receive the result. GNU C with -Wformat would warn you of this mistake.)
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find: problems escaping printf-command string

Hi Folks! Can you help me with this find -printf command. I seem to be unable to execute the printf-command from my shell script. I'm confused: :confused: My shell script snippet looks like this: #!/bin/sh .. COMMAND="find ./* -printf '%p %m %s %u %g \n'" echo "Command: ${COMMAND}"... (1 Reply)
Discussion started by: grahamb
1 Replies

2. Shell Programming and Scripting

How to format the output using float in awk{printf}

Hi I'm using awk to manipulate the data in the 6th field of the file xxx_yyy.hrv. The sample data that is available in this field is given below 220731.7100000000000000 When i tried using this command cat xxx_yyy.hrv | awk '{printf("%23.16f\n",$6*-1)}' I get the output as... (4 Replies)
Discussion started by: angelarosh
4 Replies

3. Programming

capture the output of printf into another variable

Hi , I wonder if in java I can pipe the below output of the printf into a variable: System.out.printf(" This is a test %s\n", myVariable); I want to keep the output of the printf command to create my history array. Thanks. (2 Replies)
Discussion started by: arizah
2 Replies

4. Shell Programming and Scripting

printf Hexadecimal output

printf "%X\n" "A" 41 printf "%X\n" "2" 2 Expected 32 (not 2). Is there a "printf" which will output the hexadecimal value of a numeric character? (9 Replies)
Discussion started by: methyl
9 Replies

5. Shell Programming and Scripting

Problems with awk printf, formatted output

Hi, i have a script, which is incomplete, am on my way developing it. Input 1,12,2012,IF_TB001 2,12,2012,3K3 3,Z56,00000,25,229,K900,00, ,3G3, ,USD, ,0000000000,000, , , , 550000000 3,Z56,00000,53,411,W225,00,000, , ,USD,OM170,0000000000,000, , , , -550000000 4,Z56,COUNT, 4,SUM LOC,... (19 Replies)
Discussion started by: selvankj
19 Replies

6. Shell Programming and Scripting

Excel table like output with printf

Hi All; I try to create a excel like table with headers and some fields containing values, other long and complex mathematic formulas. I have some header like : Name Formula Value True/False Under name column, they are some formula names, formula column some long mathematic formulas... (9 Replies)
Discussion started by: reseki
9 Replies

7. Shell Programming and Scripting

Managing output... echo or printf?

Hello script guru's as i write more and more code i always block at managing output... either writing to standard out, writing to files via std out (log, temp file, etc). Don't get me wrong 99% of the time it DOES the job but maybe there is more efficient. I'm writing a small script to... (2 Replies)
Discussion started by: maverick72
2 Replies

8. UNIX for Beginners Questions & Answers

How to use printf to output a shell variable path?

So I created two shell variables: COLUMN1_HEADING, COLUMN2_HEADING. They have values: COLUMN1_HEADING="John" COLUMN2_HEADING="123456789" How would I use printf to get it to print an output like this: $COLUMN1_HEADING\t$COLUMN2_HEADING\nJohn\t123456789\n Thanks! (3 Replies)
Discussion started by: steezuschrist96
3 Replies
GAMMA(3)						User Contributed Perl Documentation						  GAMMA(3)

NAME
PDL::GSLSF::GAMMA - PDL interface to GSL Special Functions DESCRIPTION
This is an interface to the Special Function package present in the GNU Scientific Library. SYNOPSIS
Functions FUNCTIONS
gsl_sf_lngamma Signature: (double x(); double [o]y(); double [o]s(); double [o]e()) Log[Gamma(x)], x not a negative integer Uses real Lanczos method. Determines the sign of Gamma[x] as well as Log[|Gamma[x]|] for x < 0. So Gamma[x] = sgn * Exp[result_lg]. gsl_sf_gamma Signature: (double x(); double [o]y(); double [o]e()) Gamma(x), x not a negative integer gsl_sf_gammastar Signature: (double x(); double [o]y(); double [o]e()) Regulated Gamma Function, x > 0 Gamma^*(x) = Gamma(x)/(Sqrt[2Pi] x^(x-1/2) exp(-x)) = (1 + 1/(12x) + ...), x->Inf gsl_sf_gammainv Signature: (double x(); double [o]y(); double [o]e()) 1/Gamma(x) gsl_sf_lngamma_complex Signature: (double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()) Log[Gamma(z)] for z complex, z not a negative integer. Calculates: lnr = log|Gamma(z)|, arg = arg(Gamma(z)) in (-Pi, Pi] gsl_sf_taylorcoeff Signature: (double x(); double [o]y(); double [o]e(); int n) x^n / n! gsl_sf_fact Signature: (x(); double [o]y(); double [o]e()) n! gsl_sf_doublefact Signature: (x(); double [o]y(); double [o]e()) n!! = n(n-2)(n-4) gsl_sf_lnfact Signature: (x(); double [o]y(); double [o]e()) ln n! gsl_sf_lndoublefact Signature: (x(); double [o]y(); double [o]e()) ln n!! gsl_sf_lnchoose Signature: (n(); m(); double [o]y(); double [o]e()) log(n choose m) gsl_sf_choose Signature: (n(); m(); double [o]y(); double [o]e()) n choose m gsl_sf_lnpoch Signature: (double x(); double [o]y(); double [o]s(); double [o]e(); double a) Logarithm of Pochammer (Apell) symbol, with sign information. result = log( |(a)_x| ), sgn = sgn( (a)_x ) where (a)_x := Gamma[a + x]/Gamma[a] gsl_sf_poch Signature: (double x(); double [o]y(); double [o]e(); double a) Pochammer (Apell) symbol (a)_x := Gamma[a + x]/Gamma[x] gsl_sf_pochrel Signature: (double x(); double [o]y(); double [o]e(); double a) Relative Pochammer (Apell) symbol ((a,x) - 1)/x where (a,x) = (a)_x := Gamma[a + x]/Gamma[a] gsl_sf_gamma_inc_Q Signature: (double x(); double [o]y(); double [o]e(); double a) Normalized Incomplete Gamma Function Q(a,x) = 1/Gamma(a) Integral[ t^(a-1) e^(-t), {t,x,Infinity} ] gsl_sf_gamma_inc_P Signature: (double x(); double [o]y(); double [o]e(); double a) Complementary Normalized Incomplete Gamma Function P(a,x) = 1/Gamma(a) Integral[ t^(a-1) e^(-t), {t,0,x} ] gsl_sf_lnbeta Signature: (double a(); double b(); double [o]y(); double [o]e()) Logarithm of Beta Function Log[B(a,b)] gsl_sf_beta Signature: (double a(); double b();double [o]y(); double [o]e()) Beta Function B(a,b) AUTHOR
This file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it> All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL SF modules were written by G. Jungman. perl v5.8.0 2003-01-29 GAMMA(3)
All times are GMT -4. The time now is 09:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy