Your program does not compile. What is "1/W.CR" supposed to be? That is not valid C.
Ever heard the old adage "measure with micrometer, mark with chalk, cut with axe"? Not even pi is accurate here, you're not going to get anything fantastic out.
You can force scientific notation with %e. From man 3 printf:
Code:
e, E The double argument is rounded and converted in the style
[-]d.ddde+-dd where there is one digit before the decimal-point
character and the number of digits after it is equal to the pre-
cision; if the precision is missing, it is taken as 6; if the
precision is zero, no decimal-point character appears. An E
conversion uses the letter E (rather than e) to introduce the
exponent. The exponent always contains at least two digits; if
the value is zero, the exponent is 00.
I am trying to compare 2 float values using if
the foll code does not work
a=1.4
b=1.6
if test $a -gt $b
then
echo "$a is max"
else
echo "$b is max"
fi
does -gt work for floating point numbers, if not how do go about for my requirement? can i use bc ? pls help
thanks in advance... (2 Replies)
Hi
I know its a dumb question but can any one please explain me the difference of executing a shell script in the following 2 ways.
. script.sh
sh script.sh
I have a problem if I execute the following code as sh script.sh
DB_CNT_ALW=0.20
SCT_VAR=0.05
if ; then
echo "== Difference... (3 Replies)
Good morning,
I'm testing the use of ceilf:
/*Filename: str.c*/
#include <stdio.h>
#include <math.h>
int main (void)
{
float ceilf(float x);
int dev=3, result=0;
float tmp = 3.444f;
printf("Result: %f\n",ceilf(tmp));
return 0;
} (1 Reply)
Today I spent longer than I'd like to admit figuring out how to write a Bourne shell IF statement that tests a FLOAT value before executing a block of statements. Here's the solution I found, which invokes bc. Hope this will come in handy for someone:
value =
testval =
if
then
body... (5 Replies)
Hi Guys,
here is a part of my source code. This part is reponsible to get the minimun of a few values:
..........
MAX=0.00
for a in `cat $OFILE`
do
if
then
... (2 Replies)
I have written a phyton script that accepts command line arguments. I am setting defaults for some of them if the user does not specify them. However I want to print the user values and the defaulted values seperately. However, once I set the default values, then I cannot use
if... (0 Replies)
Dear friends,
I want to print variables' values in certain format where space between two values of variables is "a tab"
I tried where I provided "tab" between two varibales.
But when it print values on screen its giving me output without spaces in two values.
Request you to help me in... (7 Replies)
I have a class
and want to print values in MOD using
L = new Layer* ;
How can I print the values in MOD using this object L???
class Layer
{
public :
Model* MODP;
Model* MODS; (1 Reply)
Hi All
I had requirement where I need to re-order columns in a file by using a control file.
here is the ctrl file
c1
c2
c3
source file
c3 | c1 | c2
a | b| c
I should create output file based on the ctrl file columns
o/p should look like this
c1 | c2 | c3
b| c|a
I wrote some... (9 Replies)
Hello!
I'm making an English to Morse Code translator and I was able to mostly get it all working by looking through older posts here; however, I have one small problem.
When I run it it's just printing spaces for where the characters should be. It runs the right amount of times, and if I try... (3 Replies)
Discussion started by: arcoleman10
3 Replies
LEARN ABOUT FREEBSD
j0f
J0(3) BSD Library Functions Manual J0(3)NAME
j0, j0f, j1, j1f, jn, jnf, y0, y0f, y1, y1f, yn, ynf -- Bessel functions of first and second kind
LIBRARY
Math Library (libm, -lm)
SYNOPSIS
#include <math.h>
double
j0(double x);
float
j0f(float x);
double
j1(double x);
float
j1f(float x);
double
jn(int n, double x);
float
jnf(int n, float x);
double
y0(double x);
float
y0f(float x);
double
y1(double x);
float
y1f(float x);
double
yn(int n, double x);
float
ynf(int n, float x);
DESCRIPTION
The functions j0(), j0f(), j1() and j1f() compute the Bessel function of the first kind of the order 0 and the order 1, respectively, for the
real value x; the functions jn() and jnf() compute the Bessel function of the first kind of the integer order n for the real value x.
The functions y0(), y0f(), y1(), and y1f() compute the linearly independent Bessel function of the second kind of the order 0 and the order
1, respectively, for the positive real value x; the functions yn() and ynf() compute the Bessel function of the second kind for the integer
order n for the positive real value x.
RETURN VALUES
These routines return values of their respective Bessel functions. For large positive inputs, they may underflow and return +-0.
The following applies to y0(), y0f(), y1(), y1f(), yn(), and ynf(). If x is negative, these routines will generate an invalid exception and
return NaN. If x is 0 or a sufficiently small positive number, these routines will generate an overflow exception and return -infinity.
SEE ALSO math(3)STANDARDS
The j0(), j1(), jn(), y0(), y1(), and yn() functions conform to IEEE Std 1003.1-2001 (``POSIX.1''). The float versions are extensions.
HISTORY
This set of functions appeared in Version 7 AT&T UNIX.
BSD February 18, 2008 BSD