Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

finite(3) [redhat man page]

ISINF(3)						     Linux Programmer's Manual							  ISINF(3)

NAME
isinf, isnan, finite - test for infinity or not-a-number (NaN) SYNOPSIS
#include <math.h> int isinf(double value); int isnan(double value); int finite(double value); DESCRIPTION
The isinf() function returns -1 if value represents negative infinity, 1 if value represents positive infinity, and 0 otherwise. The isnan() function returns a non-zero value if value is "not-a-number" (NaN), and 0 otherwise. The finite() function returns a non-zero value if value is neither infinite nor a "not-a-number" (NaN) value, and 0 otherwise. CONFORMING TO
BSD 4.3 GNU
1993-06-02 ISINF(3)

Check Out this Related Man Page

FINITE(3)						     Linux Programmer's Manual							 FINITE(3)

NAME
finite, finitef, finitel, isinf, isinff, isinfl, isnan, isnanf, isnanl - BSD floating-point classification functions SYNOPSIS
#include <math.h> int finite(double x); int finitef(float x); int finitel(long double x); int isinf(double x); int isinff(float x); int isinfl(long double x); int isnan(double x); int isnanf(float x); int isnanl(long double x); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): finite(), finitef(), finitel(): _BSD_SOURCE || _SVID_SOURCE isinf(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99 isinff(), isinfl(): _BSD_SOURCE || _SVID_SOURCE isnan(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; or cc -std=c99 isnanf(), isnanl(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 DESCRIPTION
The finite() functions return a nonzero value if x is neither infinite nor a "not-a-number" (NaN) value, and 0 otherwise. The isnan() functions return a nonzero value if x is a NaN value, and 0 otherwise. The isinf() functions return 1 if x is positive infinity, -1 if x is negative infinity, and 0 otherwise. NOTES
Note that these functions are obsolete. C99 defines macros isfinite(), isinf(), and isnan() (for all types) replacing them. Further note that the C99 isinf() has weaker guarantees on the return value. See fpclassify(3). SEE ALSO
fpclassify(3) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-05 FINITE(3)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

the given code goes in infinite loop and does not increment variable i

code is as #!/bin/sh i=1; while do welcome $i times; i='expr $i+1'; done exit 0; (6 Replies)
Discussion started by: mrityunjay22
6 Replies

2. Shell Programming and Scripting

Which is more efficient - sleep or infinite while?

Hi i need to make a script to check disk space every hour. ****Note that cron is not allowed. So i need to use either sleep or while 1 ...pls suggest which is more efficient in this scenario? And is there any other way to do the task? Thanks, Ashish (7 Replies)
Discussion started by: ashish_uiit
7 Replies

3. Shell Programming and Scripting

Running a script in INFINITE LOOP

Hi All, I have a requirement as below. I supposed to get a file from Source system once in a month. But we dont know when the source system will send the file. My script has to wait for that file in LOOP once it gets the file then it has to FTP the file. I thought of scheduling the job... (5 Replies)
Discussion started by: Raamc
5 Replies

4. Shell Programming and Scripting

infinite loop to check process is running

Hi, I got a simple script working to check if a process is running and then email if it is not running anymore. My scenario is that I need to make sure the process is always running so instead of running the below script via cron I think it is better to a have a looping script to check... (12 Replies)
Discussion started by: yabai
12 Replies

5. Programming

Is my code in an Infinite Loop?

Production C code compiled without the dash-g option is running, and seems to be in an infinite loop. Is there a way to tell? Is there a diagnostic tool that will report what objects or what lines of code or even what functions are being executed? Or is my best option to kill it with a dump? ... (5 Replies)
Discussion started by: marcus121
5 Replies

6. Solaris

Infinite for loop is taking too much CPU usage %

Hi All, I wrote one simple for loop shell script which prints number..but this loop is infinite...but its taking lot of CPU (15.7) %. if i am using sleep cmd then cpu usage become 0.4 %. Is there anyway to reduce this CPU usage without using sleep cmd? i dont want 2 use sleep cmd... (7 Replies)
Discussion started by: pa.chidhambaram
7 Replies

7. Shell Programming and Scripting

infinite while do loop problem

hi all, this is how my scrip looks like #!/bin/sh bindir='/opt/apps/script/bin' datadir='/opt/apps/script/data' dir='/opt/apps/script' while : ; do ls -1rt /opt/apps/script/data/check.txt*|tail -1 > /dev/null 2>&1 if ;then chmod +rwx $bindir/dummy2.sh ... (8 Replies)
Discussion started by: tententen
8 Replies

8. Shell Programming and Scripting

Infinite while loop

what is the difference between while:,while true and while false? (6 Replies)
Discussion started by: proactiveaditya
6 Replies

9. Shell Programming and Scripting

30 Load average with fping script

Hi! I've make a script that gets a list of 200 Ip's and calls another script once per ip in a infinite loop with a pause of 10 seconds. So It calls over 200 times every 10 seconds the second script (that makes a fping). But this cause a load average of 30. I've been reading about this and I... (4 Replies)
Discussion started by: charlscross
4 Replies

10. Shell Programming and Scripting

Problem with pipes on infinite streams

Here is an example code that shows the issue I have: #!/bin/bash counter() { seq 1000 | while read NUM; do echo $NUM echo "debug: $NUM" >&2 sleep 0.1 # slow it down so we know when this loop really ends done } counter | grep --line-buffered "" | head -n1 ... (10 Replies)
Discussion started by: tokland
10 Replies

11. Programming

Infinite thread

I created a thread which pings a machine for every 15 seconds. I made my thread function in infinite loop. Main process also in infinite loop and will run for years. I wonder the thread will continue as long as main process continuous or will thread terminates at some point? Is there any life... (6 Replies)
Discussion started by: satish@123
6 Replies

12. Shell Programming and Scripting

My for loop decides to become an infinite loop?

Hi, I was debating if I should put this in the dummies or scripts section, I apologize in advance if I chose poorly. Fairly new to Unix and BASH scripting but I thought I made it fairly well given my limited understanding. However, the output indicates that it's looping and I'm ending up with a... (5 Replies)
Discussion started by: gotreef
5 Replies

13. Shell Programming and Scripting

How to stop infinite loop

Im unable to stop the below infinite loop (bash script). Can someone tell me why this isnt responding to signals eg: ctrl+c (SIGINT) or ctrl+z c=0 test_loop() { c=$(($c+1)) echo "count value is : $c " sleep 1 test_loop } Im using: SunOS 5.10 PS: If run this as... (13 Replies)
Discussion started by: Arun_Linux
13 Replies

14. Shell Programming and Scripting

Read function is going in infinite in another script having while loop

Hello Experts, I have created one user confirmation process that will ask for user input. I have created one func for it. The issue is if i call it as normal then it works fine but if i am calling it in another script(in while loop) . It is going in infinite loop and not asking for user input. ... (8 Replies)
Discussion started by: looney
8 Replies

15. UNIX for Beginners Questions & Answers

Is it a joke or a command?

Hello, I have found some commands in a forum under "top ten unix commands" topic and I'd like to ask: what does below command do: Could it really be a command or a joke? :(){ :|:& };: Thanks Boris (6 Replies)
Discussion started by: baris35
6 Replies