08-21-2015
Quote:
Originally Posted by
Don Cragun
So much for getting some sleep...
According to the standards, conforming shells must use signed long int (or something else that provides the same results when working with values in the range of a signed long int).
That is another stroke against bash being standards compliant, then. I recall getting 64-bit numbers on systems where 'long int' is 32 bit (though honestly was quite happy to have them).
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a file of the following format.
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user... (5 Replies)
Discussion started by: nua7
5 Replies
2. UNIX for Dummies Questions & Answers
Here's my work of testing whether a number input is perfect or not..
echo Enter a number
read no
i=1
ans=0
while
do
if
then
ans='expr $ans + $i'
fi
i='expr $i + 1'
done
if
then
echo $no is perfect
else
echo $no is NOT perfect
fi (12 Replies)
Discussion started by: Cyansnow
12 Replies
3. AIX
I've got an aix-box somewhere on the network and a PC on my desk. Nothing fancy so far.
The PC is made dual-boot:
- windowsXP with putty & winSCP
or
- slackware 13 with xfce4 installed.
The aix-box runs DB2 v8.2 and I've installed db2top to monitor the database.
db2top is a character... (0 Replies)
Discussion started by: dr_te_z
0 Replies
4. Shell Programming and Scripting
Hi All,
I have a text file which looks like this:
computer programming
systems engineering
I want to get rid of these square brackets and also the text that is inside these brackets. So that my final text file looks like this:
computer programming
systems engineering
I am using... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
5. Shell Programming and Scripting
hi,
how to I do this?
i="4.000"
if ; then
echo "smaller"
fi
how do I convert the "4.000" to 4?
Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies
6. UNIX for Dummies Questions & Answers
I want to print only the lines that meet the criteria : "worde:" and "wordo;"
I got this far:
sed -n '/\(*\)\1e:\1o;/p;'
But it doesn't quite work.
Can someone please perfect it and tell me exactly how its a fixed version/what was wrong with mine?
Thanks heaps, (1 Reply)
Discussion started by: maximus73
1 Replies
7. Shell Programming and Scripting
Hi
Input File A
L006 AL01 0 (OCK)
L006 A006 0 (OCK)
L011 AR11 1 (NLOCK)
Input File B
L006 AL01 0 (OCK)
L006 A006 0 (OCK)
Need Egrep Command for perfect Match
Thanks (4 Replies)
Discussion started by: asavaliya
4 Replies
8. Shell Programming and Scripting
I have to find last delimiter in each line of a file and store the value after the last '/' in a variable in ksh script...Pls Pls help me:(The file is as shown below:
/opt/apps/cobqa/apps/abadv/bind/advc0007.bnd
/opt/apps/cobqa/apps/abbrio/bind/naac6115.bnd... (5 Replies)
Discussion started by: bhavanabahety
5 Replies
ilogb(3M) Mathematical Library Functions ilogb(3M)
NAME
ilogb, ilogbf, ilogbl - return an unbiased exponent
SYNOPSIS
cc [ flag... ] file... -lm [ library... ]
#include <math.h>
int ilogb(double x);
int ilogbf(float x);
int ilogbl(long double x);
DESCRIPTION
These functions return the exponent part of their argument x. Formally, the return value is the integral part of logr| x | as a signed
integral value, for non-zero x, where r is the radix of the machine's floating point arithmetic, , which is the value of FLT_RADIX defined
in <float.h>.
RETURN VALUES
Upon successful completion, these functions return the exponent part of x as a signed integer value. They are equivalent to calling the
corresponding logb(3M) function and casting the returned value to type int.
If x is 0, the value FP_ILOGB0 is returned. For SUSv3-conforming applications (see standards(5)), a domain error occurs.
If x is +-Inf, the value INT_MAX is returned. For SUSv3-conforming applications, a domain error occurs.
If x is NaN, the value FP_ILOGBNAN is returned. For SUSv3-conforming applications, a domain error occurs.
ERRORS
These functions will fail if:
Domain Error The x argument is zero, NaN, or +-Inf.
If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception is
raised.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
feclearexcept(3M), fetestexcept(3M), limits.h(3HEAD), logb(3M), math.h(3HEAD), scalb(3M), attributes(5), standards(5)
SunOS 5.10 1 Nov 2003 ilogb(3M)