📄 labs.c
字号:
/*FUNCTION<<labs>>---long integer absolute valueINDEX labsANSI_SYNOPSIS #include <stdlib.h> long labs(long <[i]>);TRAD_SYNOPSIS #include <stdlib.h> long labs(<[i]>) long <[i]>;DESCRIPTION<<labs>> returns@tex$|x|$,@end texthe absolute value of <[i]> (also called the magnitudeof <[i]>). That is, if <[i]> is negative, the result is the oppositeof <[i]>, but if <[i]> is nonnegative the result is <[i]>.The similar function <<abs>> uses and returns <<int>> rather than<<long>> values.RETURNSThe result is a nonnegative long integer.PORTABILITY<<labs>> is ANSI.No supporting OS subroutine calls are required.*/#include <stdlib.h>long_DEFUN (labs, (x), long x){ if (x < 0) { x = -x; } return x;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -