mirror of
https://github.com/reactos/reactos.git
synced 2025-06-20 07:36:05 +00:00
26 lines
319 B
C++
26 lines
319 B
C++
![]() |
//
|
||
|
// labs.cpp
|
||
|
//
|
||
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
//
|
||
|
// Defines labs(), which computes the absolute value of a number.
|
||
|
//
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
extern "C" {
|
||
|
|
||
|
|
||
|
|
||
|
#pragma function(labs)
|
||
|
|
||
|
|
||
|
|
||
|
long __cdecl labs(long const number)
|
||
|
{
|
||
|
return number >= 0 ? number : -number;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
} // extern "C"
|