# hypot(3m) [bsd man page]

```HYPOT(3M)																 HYPOT(3M)

NAME
hypot, cabs - Euclidean distance, complex absolute value

SYNOPSIS
#include <math.h>

double hypot(x,y)
double x,y;

double cabs(z)
struct {double x,y;} z;

DESCRIPTION
Hypot(x,y)  and cabs(x,y) return sqrt(x*x+y*y) computed in such a way that underflow will not happen, and overflow occurs only if the final
result deserves it.

hypot(infinity,v) = hypot(v,infinity) = +infinity for all v, including NaN.

ERROR (due to Roundoff, etc.)
Below 0.97 ulps.  Consequently hypot(5.0,12.0) = 13.0 exactly; in general, hypot and cabs return an integer whenever an	integer  might	be
expected.

The  same  cannot  be  said  for the shorter and faster version of hypot and cabs that is provided in the comments in cabs.c; its error can
exceed 1.2 ulps.

NOTES
As might be expected, hypot(v,NaN) and hypot(NaN,v) are NaN for all finite v; with "reserved operand" in place of "NaN", the same  is  true
on  a  VAX.   But programmers on machines other than a VAX (it has no infinity) might be surprised at first to discover that hypot(+-infin-
ity,NaN) = +infinity.  This is intentional; it happens because hypot(infinity,v)  =  +infinity  for  all  v,  finite  or  infinite.   Hence
hypot(infinity,v) is independent of v.  Unlike the reserved operand on a VAX, the IEEE NaN is designed to disappear when it turns out to be
irrelevant, as it does in hypot(infinity,NaN).

math(3M), sqrt(3M)

AUTHOR
W. Kahan

4th Berkeley Distribution					   May 12, 1986 							 HYPOT(3M)```

## Check Out this Related Man Page

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

NAME
hypot, hypotf -- Euclidean distance and complex absolute value functions

LIBRARY
Math Library (libm, -lm)

SYNOPSIS
#include <math.h>

double
hypot(double x, double y);

float
hypotf(float x, float y);

DESCRIPTION
The hypot() functions compute the sqrt(x*x+y*y) in such a way that underflow will not happen, and overflow occurs only if the final result
deserves it.

hypot(infinity, v) = hypot(v, infinity) = +infinity for all v, including NaN.

ERRORS
Below 0.97 ulps.  Consequently hypot(5.0, 12.0) = 13.0 exactly; in general, hypot returns an integer whenever an integer might be expected.

The same cannot be said for the shorter and faster version of hypot that is provided in the comments in cabs.c; its error can exceed 1.2
ulps.

NOTES
As might be expected, hypot(v, NaN) and hypot(NaN, v) are NaN for all finite v; with "reserved operand" in place of "NaN", the same is true
on a VAX.	But programmers on machines other than a VAX (it has no infinity) might be surprised at first to discover that hypot(+-infinity,
NaN) = +infinity.	This is intentional; it happens because hypot(infinity, v) = +infinity for all v, finite or infinite.  Hence
hypot(infinity, v) is independent of v.  Unlike the reserved operand fault on a VAX, the IEEE NaN is designed to disappear when it turns out
to be irrelevant, as it does in hypot(infinity, NaN).

math(3), sqrt(3)

HISTORY
Both a hypot() function and a cabs() function appeared in Version 7 AT&T UNIX.  cabs() was removed from public namespace in NetBSD 5.0 to
avoid conflicts with the complex function in C99.

BSD								 February 12, 2007							       BSD```
Man Page

## awk substr

Hello life savers!! Is there any way to use substr in awk command for returning one part of a string from declared start and stop point? I mean I know we have this: substr(string, start, length) Do we have anything like possible to use in awk ? : substr(string, start, stop) ...

## Grep float/integers but skip some integers

Hi, I am working in bash in Mac OSX, I have following 'input.txt' file: <INFO> HypoTestTool: >>> Done running HypoTestInverter on the workspace combined <INFO> HypoTestTool: The computed upper limit is: 11 +/- 1.02651 <INFO> HypoTestTool: expected limit (median) 11 <INFO> HypoTestTool: ...

## Want to remove all lines but not latest 50 lines from a file

Hi, I have a huge file which has Lacs of lines. File system got full. I want your guys help to suggest me a solution so that I can remove all lines from that file but not last 50,000 lines. I want solution which can remove lines from existing file so that I can have some space left with.

## Join not working properly

I want to join two files , with file 1 col 3 and file 2 col 1 as key. The join command is erratic for some reason. File 2 is a master file having all the names, and file 1 has some values. I want to add the names from fil2 in file 1. If I use the original master file, some output is missing. ...

## Is C worth the effort?

Hello guys, I have a little question. I think about learning c or c++ because im very interessted in low Level programming. And because i love Unix Too i thought C would be the better choice since Most it Done in c. Or should i learn c++? Because C++ has all this nice Features like oop and...

## Rsync exclude & include?

hi I have a few folders and a few files , for example Directory A B C D E Files 1 2 3 4 5 I want B directory and "2" File that does not sync But other directories and file sync What is the solution ? Is there a way to sync time is under one minute? os centos 6.8 thanks...

## Noob trying to improve

Hi everyone! This is my first post here, I hope that I will not already be violating any rule! I also would like to apologize in advance as my post will definitely be a noob post... please have patience and faith :rolleyes:! Now that I have set the ground rules :D:D, my objective is trying...

## Question regarding tar command.

I wish my tar -xf hello.tar command should return successful even if the tar has already been extracted at the same location i.e. exists by the same or a different user. Currently i am getting this error as another user has extracted the same tar at the same location. tar: README - cannot...

## Long file names within shell script

I am downloading a zip file that contain files that are very long. I am trying to process them, but cannot. I can move the files from one directory to another at the shell prompt, but not within a shell script, I get a stat error. The files look somewhat like this; ...

## In shell scripting found "\n-" and don't know what is it for

Working on UNIX shell scripting I found in env file the following export H1="\n- " echo "\${H1} Waiting for dependencies of \${MONITOR_KEY} to be satisfied ..." >> \${LOG} What is in shell \n- The new line character? Thanks for contribution

## Avoiding external utilities

under past circumstances, id be fine running commands like this: case 1: printf '%s\n' "\${MASSIVETEXT}" | egrep "i am on the first line" case 2: vprintf '%s\n' "\${MASSIVETEXT}" | egrep -v "i am on the first line" This works fine. Bit it calls external utility "egrep" and "printf". ...

## AIX version selection

Hi, I would like to upgrade my AIX box 6.1 to 7.1/7.2. Current info of my AIX 6.1 box / > oslevel -s 6100-09-11-1810 System Model: IBM,9117-MMD Machine Serial Number: xxx Processor Type: PowerPC_POWER7 Processor Implementation Mode: POWER 7 Processor Version: PV_7_Compat Number Of...