# finite(3) [netbsd man page]

```FINITE(3)						   BSD Library Functions Manual 						 FINITE(3)

NAME
finite, finitef -- tests for finite values

LIBRARY
Math Library (libm, -lm)

SYNOPSIS
#include <math.h>

int
finite(double x);

int
finitef(float x);

DESCRIPTION
The finite() function returns the value 1 when

-infinity < x < +infinity.

Otherwise a zero is returned (that is, |x| = infinity or x is NaN).

isfinite(3), math(3)

STANDARDS
The described functions conform to IEEE Std 754-1985.  Note that unlike isfinite(3), neither function is present in the ISO C-language stan-
dards or in the IEEE POSIX standards.

HISTORY
The finite and finitef() functions first appeared in 4.3BSD.

BSD								   July 28, 2011							       BSD```

## 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(),  finitef(),  and finitel() functions return a nonzero value if x is neither infinite nor a "not-a-number" (NaN) value, and 0
otherwise.

The isnan(), isnanf(), and isnanl() functions return a nonzero value if x is a NaN value, and 0 otherwise.

The isinf(), isinff(), and isinfl() functions return 1 if x is positive infinity, -1 if x is negative infinity, and 0 otherwise.

ATTRIBUTES
The finite(), finitef(), finitel(), isinf(), isinff(), isinfl(), isnan(), isnanf(), and isnanl() functions are thread-safe.

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).

fpclassify(3)

COLOPHON
This  page is part of release 3.53 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/.

2013-07-22								 FINITE(3)```
Man Page

## 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;

## 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

## 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...

## 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...

## 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? ...

## 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...

## 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 ...

## Infinite while loop

what is the difference between while:,while true and while false?

## 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...

## 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 ...

## 11. Programming

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...

## 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...

## 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...

## 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. ...

## 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