1*9e66e6d7Sabs /* $NetBSD: qabs.c,v 1.7 2012/06/25 22:32:45 abs Exp $ */
26dda330eSthorpej
37681b92cSjtc /*-
47681b92cSjtc * Copyright (c) 1990 The Regents of the University of California.
57681b92cSjtc * All rights reserved.
67681b92cSjtc *
77681b92cSjtc * Redistribution and use in source and binary forms, with or without
87681b92cSjtc * modification, are permitted provided that the following conditions
97681b92cSjtc * are met:
107681b92cSjtc * 1. Redistributions of source code must retain the above copyright
117681b92cSjtc * notice, this list of conditions and the following disclaimer.
127681b92cSjtc * 2. Redistributions in binary form must reproduce the above copyright
137681b92cSjtc * notice, this list of conditions and the following disclaimer in the
147681b92cSjtc * documentation and/or other materials provided with the distribution.
15eb7c1594Sagc * 3. Neither the name of the University nor the names of its contributors
167681b92cSjtc * may be used to endorse or promote products derived from this software
177681b92cSjtc * without specific prior written permission.
187681b92cSjtc *
197681b92cSjtc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
207681b92cSjtc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
217681b92cSjtc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
227681b92cSjtc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
237681b92cSjtc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
247681b92cSjtc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
257681b92cSjtc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
267681b92cSjtc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
277681b92cSjtc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
287681b92cSjtc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
297681b92cSjtc * SUCH DAMAGE.
307681b92cSjtc */
317681b92cSjtc
32bd906777Schristos #include <sys/cdefs.h>
337681b92cSjtc #if defined(LIBC_SCCS) && !defined(lint)
346dda330eSthorpej #if 0
356dda330eSthorpej static char *sccsid = "from: @(#)labs.c 5.2 (Berkeley) 5/17/90";
366dda330eSthorpej #else
37*9e66e6d7Sabs __RCSID("$NetBSD: qabs.c,v 1.7 2012/06/25 22:32:45 abs Exp $");
386dda330eSthorpej #endif
397681b92cSjtc #endif /* LIBC_SCCS and not lint */
407681b92cSjtc
4143fa6fe3Sjtc #include "namespace.h"
427681b92cSjtc #include <stdlib.h>
437681b92cSjtc
4443fa6fe3Sjtc #ifdef __weak_alias
__weak_alias(qabs,_qabs)4560549036Smycroft __weak_alias(qabs,_qabs)
4643fa6fe3Sjtc #endif
4743fa6fe3Sjtc
487681b92cSjtc quad_t
49*9e66e6d7Sabs qabs(quad_t j)
507681b92cSjtc {
517681b92cSjtc return(j < 0 ? -j : j);
527681b92cSjtc }
53