mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Release calc version 2.11.1t1
This commit is contained in:
36
qmath.c
36
qmath.c
@@ -1,11 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 1997 David I. Bell
|
||||
* Permission is granted to use, distribute, or modify this source,
|
||||
* provided that this copyright notice remains intact.
|
||||
* qmath - extended precision rational arithmetic primitive routines
|
||||
*
|
||||
* Extended precision rational arithmetic primitive routines
|
||||
* Copyright (C) 1999 David I. Bell and Ernest Bowen
|
||||
*
|
||||
* Primary author: David I. Bell
|
||||
*
|
||||
* Calc is open software; you can redistribute it and/or modify it under
|
||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||
* Public License for more details.
|
||||
*
|
||||
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.1 $
|
||||
* @(#) $Id: qmath.c,v 29.1 1999/12/14 09:16:14 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/qmath.c,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:21
|
||||
* File existed as early as: before 1990
|
||||
*
|
||||
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include "qmath.h"
|
||||
#include "config.h"
|
||||
@@ -815,10 +839,6 @@ qscale(NUMBER *q, long pow)
|
||||
|
||||
if (qiszero(q) || (pow == 0))
|
||||
return qlink(q);
|
||||
if ((pow > 1000000L) || (pow < -1000000L)) {
|
||||
math_error("Very large scale value");
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
numshift = zisodd(q->num) ? 0 : zlowbit(q->num);
|
||||
denshift = zisodd(q->den) ? 0 : zlowbit(q->den);
|
||||
if (pow > 0) {
|
||||
|
Reference in New Issue
Block a user