|
CC78K0S Datasheet, PDF (222/520 Pages) NEC – C Compiler Ver.1.30 or Later Language | |||
|
◁ |
CHAPTER 10 LIBRARY FUNCTIONS
5-9 abs
labs
Utility Functions
FUNCTION
The mathematical function abs returns the absolute value of its int type argument.
The mathematical function labs returns the absolute value of its long type argument.
HEADER
stdlib.h
FUNCTION PROTOTYPE
int abs(int j);
long int labs(long int j);
Function
abs
Arguments
j ... Absolute value to be
obtained
labs
Return Value
⢠Absolute value of j if j falls
within:
â32767 ⤠j ⤠32767
⢠â32768 (0x8000) if j is
â32768
⢠Absolute value of j if j falls
within
â2147483647 ⤠j â¤
2147483647
⢠â2147483648
(0x80000000) if the value of
j is â2147483648
EXPLANATION
abs
⢠The abs returns the absolute value of its int type argument.
⢠If j is â32768, the function returns â32768.
labs
⢠The labs returns the absolute value of its long type argument.
⢠If the value of j is â2147483648, the function returns â2147483648.
222
Userâs Manual U14872EJ1V0UM
|
▷ |