Hello,
I'm trying to write a while loop for a decimal value in tcsh which I know can't be done. Instead I want my increments to be one order of magnitude too large and then divide it by 10 when I use the variable. However, I don't know how to divide my variable and set it as another.
I then want to set PI to equal RI/10 to use PI in another program so my PI values will range from 1.0 to 3.0.
Thanks
Last edited by Scott; 01-19-2010 at 11:48 AM..
Reason: Please use code tags
Heres a script i wrote as a bit of practise. What it does is insert a line in the middle of a file. The line being $1 and the file being $2
#!/bin/bash
rm tempfile
touch tempfile
count=1
linenum= `wc -l < $2`
if
then
echo $1 >> $2
else
even=`expr "$linenum" % 2`
if
then... (3 Replies)
Hello everybody,
I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
if input to the perl program is ' ( p * ((a+b) * (c+d))) + q ' it shuld give the output as ' pac + pad + pbc + pbd + q ' .can anyone suggest a way to do this ? (7 Replies)
Hi All
I've made a few scripts which using GDAL extract the value of a pixel within a given raster. The purpose is to work out the combine value of every pixel. I thought there may have been an easier way to do this but alas!
The code below extracts the pixel value at position X Y. The... (3 Replies)
Hi, I am trying to make a maths calculator that:
1. Prompts the user for a number.
2. Prompts the user for an operation (add, subtract, divide or multiply)
3. Prompts the user for a number.
4. Prompts the user for another operation (same as above) OR the option to get the result for the... (4 Replies)
Hi,
Need help on this. I need to increment a variable by 1 but retain as 2 characters.
I am using expr to do additions:
NEWSERIAL=`expr $SERIAL + 1`
$SERIAL can range from 01-99. After adding "1", I need the result to be 2 characters, eg: 02+1 = 03. By default expr will truncate the... (4 Replies)
Hi All,
i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way??
#!/bin/ksh
##script is sample.ksh
age=$1
gender=$2
class=$3
.
.
.... (3 Replies)
Sometimes it is handy to protect long scripts in C++.
The following syntax works fine for simple commands:
#define SHELLSCRIPT1 "\
#/bin/bash \n\
echo \"hello\" \n\
"
int main ()
{
cout <<system(SHELLSCRIPT1);
return 0;
}
Unfortunately for there are problems for:
1d arrays:... (10 Replies)
Hi guys...
I am loving this integer maths thing.
64 bit systems are certainly easier than 32 bit, but hey, I don't intend to leave out my fav' platform.
Using one of the 'Brothers' methods, URL inside the code.
#!/bin/sh
#
# #!/usr/local/bin/dash
# e_constant.sh
# Brother's formula .
#... (2 Replies)
Discussion started by: wisecracker
2 Replies
LEARN ABOUT HPUX
powd128
powd64(3M)powd64(3M)NAME
powd64(), powd128(), powd32() - decimal power functions
SYNOPSIS DESCRIPTION
The function returns
is a version of it takes arguments and returns a result.
is a version of it takes arguments and returns a result.
These math functions are supported for HP-UX 11i Version 3 September 2008 Update and forward.
USAGE
To use any of these functions, compile with the option.
Make sure your program defines and then includes
Link in the math library by specifying or on the linking command line.
For more information, see the at the following site:
RETURN VALUE
and raises the divide-by-zero floating-point exception for y an odd integer < 0.
returns +infinity and raises the divide-by-zero floating-point exception for y<0 and not an odd integer.
for y an odd integer > 0.
returns +0 for y>0 and not an odd integer.
returns 1.
returns 1 for any x, even NaN.
returns 1 for any x, even NaN.
returns NaN and raises the invalid floating-point exception for finite x<0 and finite non-integer y.
returns +infinity for |x|<1.
returns +0 for |x|>1.
returns +0 for |x|<1.
returns +infinity for |x|>1.
returns -0 for y an odd integer < 0.
returns +0 for y<0 and not an odd integer.
returns -infinity for y an odd integer > 0.
returns +infinity for y>0 and not an odd integer.
returns +0 for y<0.
returns +inf for y>0.
Otherwise, if either argument is NaN, then returns NaN.
returns the properly signed infinity (or, in some non-default rounding direction modes, the properly signed maximum-magnitude finite num-
ber) in lieu of a value whose magnitude is too large, and raises the overflow and inexact exceptions.
raises the underflow exception whenever a result is tiny (essentially subnormal or zero) and inexact.
raises the inexact exception whenever a rounded result does not equal the mathematical result.
ERRORS
For finite x<0 and finite non-integer y, sets to
sets to if y is an odd integer < 0.
sets to if y<0 and not an odd integer.
If the correct value would overflow, sets to
SEE ALSO cbrtd64(3M), expd64(3M), logd64(3M), scalblnd64(3M), scalbnd64(3M), sqrtd64(3M), math(5).
STANDARDS CONFORMANCE
These functions conform to ISO/IEC TR 24732, "Extension for the programming language C to support decimal floating-point arithmetic".
HP Integrity Server Only powd64(3M)