ISGREATER(3) BSD Library Functions Manual ISGREATER(3)NAME
isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered -- compare two floating-point numbers
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <math.h>
int
isgreater(real-floating x, real-floating y);
int
isgreaterequal(real-floating x, real-floating y);
int
isless(real-floating x, real-floating y);
int
islessequal(real-floating x, real-floating y);
int
islessgreater(real-floating x, real-floating y);
int
isunordered(real-floating x, real-floating y);
DESCRIPTION
Each of the macros isgreater(), isgreaterequal(), isless(), islessequal(), and islessgreater() takes arguments x and y and returns a non-zero
value if and only if its nominal relation on x and y is true. These macros always return zero if either argument is not a number (NaN), but
unlike the corresponding C operators, they never raise a floating point exception.
The isunordered() macro takes arguments x and y, returning non-zero if either x or y is NaN. For any pair of floating-point values, one of
the relationships (less, greater, equal, unordered) holds.
SEE ALSO fpclassify(3), math(3), signbit(3)STANDARDS
The isgreater(), isgreaterequal(), isless(), islessequal(), islessgreater(), and isunordered() macros conform to ISO/IEC 9899:1999
(``ISO C99'').
BSD December 1, 2008 BSD
Check Out this Related Man Page
ISGREATER(3) BSD Library Functions Manual ISGREATER(3)NAME
isgreater, isgreaterequal, isless, islessequal, islessgreater, isunordered -- compare two floating-point numbers
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <math.h>
int
isgreater(real-floating x, real-floating y);
int
isgreaterequal(real-floating x, real-floating y);
int
isless(real-floating x, real-floating y);
int
islessequal(real-floating x, real-floating y);
int
islessgreater(real-floating x, real-floating y);
int
isunordered(real-floating x, real-floating y);
DESCRIPTION
Each of the macros isgreater(), isgreaterequal(), isless(), islessequal(), and islessgreater() takes arguments x and y and returns a non-zero
value if and only if its nominal relation on x and y is true. These macros always return zero if either argument is not a number (NaN), but
unlike the corresponding C operators, they never raise a floating point exception.
The isunordered() macro takes arguments x and y, returning non-zero if either x or y is NaN. For any pair of floating-point values, one of
the relationships (less, greater, equal, unordered) holds.
SEE ALSO fpclassify(3), math(3), signbit(3)STANDARDS
The isgreater(), isgreaterequal(), isless(), islessequal(), islessgreater(), and isunordered() macros conform to ISO/IEC 9899:1999
(``ISO C99'').
BSD December 1, 2008 BSD
Does anyone have a simple way of doing floating point ("fp") division? For example, if I divide 3 by 5, I can get 0.6. The built-in calc (`bc`) will perform fp multiplication, but not division, at least not straight-up (i.e., starting bc and just typing in 3/5).
I am trying to do this using... (1 Reply)
Dear Experts
As I know by "od" command in unix shell we are able to convert file in xbit intiger or floating format to ascii. Is there any way to translate IBM floating data format to ascii?? I have a file which in some specific location there are numbers written in 4byte IBM floating but I didn't... (0 Replies)
Hi,
Could any one tell me how to compare to floating point no. using test command. As -eq option works on only intergers.
i=5.4
if
then
echo "equal"
else
echo "not equal"
fi
here output will be equal even though no. are unequal.
Thanks,
ravi (1 Reply)
Hi All,
I got this script that pulls the Amps value from our RPC's , I basiclly want to compare the valued with a "limit" value -- if the numbers match or are greater than the definded value ...do something. My problem is I cant seem to figure out how to compare floating points...
here is... (1 Reply)
Is there a way to compare two floating points numbers in a bash script using perl? I've tried just using a bash if statement and it doesn't seem to support floating point numbers. Can the perl line read vars from bash then output a var to bash?
a=1.1 #from bash
b=1.5 #from bash
if... (3 Replies)
is it not possible to simply di aritmetic without using bc or awk
i have tried folllowing operatrions but they support only integer types plz suggest me code for floating using values stored in the variables.the ans i get is integer and if i input floating values i get error numeric constant... (6 Replies)
Hi I'm not using Korn93 but want to use floating point variable.
Is there any solution to do that ?
thx for help.
---------- Post updated at 02:28 PM ---------- Previous update was at 12:38 PM ----------
I have the following peace of code:
for n in `cat log.January.1.array`
do
... (3 Replies)
for example:
# I want to judge the value of $1 which should be $2<$1<$3.
temp0=`echo "$1 - $2" | bc`
temp1=`echo "$1 - $3" | bc`
if ] ; then
echo OK
else
echo False
fi
Please use code tags, thanks. (6 Replies)
Hello,
How can I multiply two variables that contain floating point numbers.
For example, how can I get the value for c
a=2.165
b=3.234
c=a+3*b
Thanks,
Guss (1 Reply)
I'm curious if there is any real difference between using " " or ' ' or no quotes at all. For example, I have a variable called EXTRACT_FILES. When I declare it, I set it to false... EXTRACT_FILES=false. I eventually use the variable later in the script (having set it to EXTRACT_FILES=true due to... (2 Replies)
Hi,
I need to understand the concept of floating IP and how can I get it working on my system. I am using Itanium boxes.
I am naive so please help me from the very basics. (2 Replies)
Hello,
I have often found bash to be difficult when it comes to floating point numbers. I have data with rows of tab delimited floating point numbers. I need to find the smallest number in each row that is not 0.0. Numbers can be negative and they do not come in any particular order for a given... (9 Replies)