BSD 4_3_Net_2 release
[unix-history] / usr / src / lib / libm / common_source / log10.c
index 361d7b8..d466bba 100644 (file)
@@ -2,21 +2,37 @@
  * Copyright (c) 1985 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1985 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of California at Berkeley. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
+ * 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.
  *
  *
- * 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
- * the sendbug(8) program, to the authors.
+ * 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    5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)log10.c    5.6 (Berkeley) 10/9/90";
 #endif /* not lint */
 
 /* LOG10(X)
 #endif /* not lint */
 
 /* LOG10(X)
@@ -57,26 +73,20 @@ static char sccsid[] = "@(#)log10.c 5.2 (Berkeley) %G%";
  * 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) */