BSD 4_3_Net_2 release
[unix-history] / usr / src / lib / libm / common_source / log10.c
index be47165..d466bba 100644 (file)
@@ -1,20 +1,39 @@
-/* 
+/*
  * Copyright (c) 1985 Regents of the University of California.
  * Copyright (c) 1985 Regents of the University of California.
- * 
- * Use and reproduction of this software are granted  in  accordance  with
- * the terms and conditions specified in  the  Berkeley  Software  License
- * Agreement (in particular, this entails acknowledgement of the programs'
- * source, and inclusion of this notice) with the additional understanding
- * that  all  recipients  should regard themselves as participants  in  an
- * ongoing  research  project and hence should  feel  obligated  to report
- * their  experiences (good or bad) with these elementary function  codes,
- * using "sendbug 4bsd-bugs@BERKELEY", to the authors.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] =
-"@(#)log10.c   1.2 (Berkeley) 8/21/85; 5.1 (ucb.elefunt) %G%";
-#endif /* not lint */
+static char sccsid[] = "@(#)log10.c    5.6 (Berkeley) 10/9/90";
+#endif /* not lint */
 
 /* LOG10(X)
  * RETURN THE BASE 10 LOGARITHM OF x
 
 /* LOG10(X)
  * RETURN THE BASE 10 LOGARITHM OF x
@@ -54,26 +73,20 @@ static char sccsid[] =
  * shown.
  */
 
  * shown.
  */
 
-#if defined(vax)||defined(tahoe)       /* VAX D format (56 bits) */
-#ifdef vax
-#define _0x(A,B)       0x/**/A/**/B
-#else  /* vax */
-#define _0x(A,B)       0x/**/B/**/A
-#endif /* vax */
-/* static double */
-/* ln10hi =  2.3025850929940456790E0     ; Hex   2^  2   *  .935D8DDDAAA8AC */
-static long    ln10hix[] = { _0x(5d8d,4113), _0x(a8ac,ddaa)};
-#define   ln10hi    (*(double*)ln10hix)
-#else  /* defined(vax)||defined(tahoe) */
-static double
-ivln10 =  4.3429448190325181667E-1    ; /*Hex   2^ -2   *  1.BCB7B1526E50E */
-#endif /* defined(vax)||defined(tahoe) */
+#include "mathimpl.h"
+
+vc(ln10hi, 2.3025850929940456790E0 ,5d8d,4113,a8ac,ddaa, 2, .935D8DDDAAA8AC)
+
+ic(ivln10, 4.3429448190325181667E-1, -2, 1.BCB7B1526E50E)
+
+#ifdef vccast
+#define        ln10hi  vccast(ln10hi)
+#endif
+
 
 double log10(x)
 double x;
 {
 
 double log10(x)
 double x;
 {
-       double log();
-
 #if defined(vax)||defined(tahoe)
        return(log(x)/ln10hi);
 #else  /* defined(vax)||defined(tahoe) */
 #if defined(vax)||defined(tahoe)
        return(log(x)/ln10hi);
 #else  /* defined(vax)||defined(tahoe) */