source: trunk/minix/lib/math/log10.c@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 566 bytes
Line 
1/*
2 * (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
4 *
5 * Author: Ceriel J.H. Jacobs
6 */
7/* $Header: /cvsup/minix/src/lib/math/log10.c,v 1.1.1.1 2005/04/21 14:56:26 beng Exp $ */
8
9#include <math.h>
10#include <errno.h>
11#include "localmath.h"
12
13double
14log10(double x)
15{
16 if (__IsNan(x)) {
17 errno = EDOM;
18 return x;
19 }
20 if (x < 0) {
21 errno = EDOM;
22 return -HUGE_VAL;
23 }
24 else if (x == 0) {
25 errno = ERANGE;
26 return -HUGE_VAL;
27 }
28
29 return log(x) / M_LN10;
30}
Note: See TracBrowser for help on using the repository browser.