Compare commits
No commits in common. "ff45e3ec2db78650cd3aa6e0a3c0456eb4587857" and "373329c0a3ca9e0f9a80e45c51812ad61c36854f" have entirely different histories.
ff45e3ec2d
...
373329c0a3
58
bc-1.06-dc_ibase.patch
Normal file
58
bc-1.06-dc_ibase.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
--- bc-1.06/dc/numeric.c.dc_ibase 2007-08-22 08:37:57.000000000 +0200
|
||||||
|
+++ bc-1.06/dc/numeric.c 2007-08-22 08:37:40.000000000 +0200
|
||||||
|
@@ -285,6 +285,8 @@ dc_getnum DC_DECLARG((input, ibase, read
|
||||||
|
int digit;
|
||||||
|
int decimal;
|
||||||
|
int c;
|
||||||
|
+ int c_buff = 0;
|
||||||
|
+ int multi = 0;
|
||||||
|
|
||||||
|
bc_init_num(&tmp);
|
||||||
|
bc_init_num(&build);
|
||||||
|
@@ -302,6 +304,9 @@ dc_getnum DC_DECLARG((input, ibase, read
|
||||||
|
}
|
||||||
|
while (isspace(c))
|
||||||
|
c = (*input)();
|
||||||
|
+ c_buff = (*input)();
|
||||||
|
+ if (isdigit(c_buff) || ('A' <= c_buff && c_buff <= 'F') || c_buff == '.')
|
||||||
|
+ multi = 1;
|
||||||
|
for (;;){
|
||||||
|
if (isdigit(c))
|
||||||
|
digit = c - '0';
|
||||||
|
@@ -309,10 +314,15 @@ dc_getnum DC_DECLARG((input, ibase, read
|
||||||
|
digit = 10 + c - 'A';
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
- c = (*input)();
|
||||||
|
+ digit = multi ? (digit >= ibase ? ibase -1 : digit) : digit;
|
||||||
|
bc_int2num(&tmp, digit);
|
||||||
|
bc_multiply(result, base, &result, 0);
|
||||||
|
bc_add(result, tmp, &result, 0);
|
||||||
|
+ if (c_buff) {
|
||||||
|
+ c = c_buff;
|
||||||
|
+ c_buff = 0;
|
||||||
|
+ } else
|
||||||
|
+ c = (*input)();
|
||||||
|
}
|
||||||
|
if (c == '.'){
|
||||||
|
bc_free_num(&build);
|
||||||
|
@@ -321,13 +331,18 @@ dc_getnum DC_DECLARG((input, ibase, read
|
||||||
|
build = bc_copy_num(_zero_);
|
||||||
|
decimal = 0;
|
||||||
|
for (;;){
|
||||||
|
- c = (*input)();
|
||||||
|
+ if (c_buff) {
|
||||||
|
+ c = c_buff;
|
||||||
|
+ c_buff = 0;
|
||||||
|
+ } else
|
||||||
|
+ c = (*input)();
|
||||||
|
if (isdigit(c))
|
||||||
|
digit = c - '0';
|
||||||
|
else if ('A' <= c && c <= 'F')
|
||||||
|
digit = 10 + c - 'A';
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
+ digit = digit >= ibase ? ibase -1 : digit;
|
||||||
|
bc_int2num(&tmp, digit);
|
||||||
|
bc_multiply(build, base, &build, 0);
|
||||||
|
bc_add(build, tmp, &build, 0);
|
||||||
24
bc-1.06.95-doc.patch
Normal file
24
bc-1.06.95-doc.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
diff -up wrk/doc/bc.1.wrk wrk/doc/bc.1
|
||||||
|
--- wrk/doc/bc.1.wrk 2013-10-02 13:36:52.066295450 +0200
|
||||||
|
+++ wrk/doc/bc.1 2013-10-02 13:35:22.738553712 +0200
|
||||||
|
@@ -174,6 +174,8 @@ The result of the expression is the sum
|
||||||
|
The result of the expression is the difference of the two expressions.
|
||||||
|
.IP "expr * expr"
|
||||||
|
The result of the expression is the product of the two expressions.
|
||||||
|
+If a and b are the scales of the two expressions, then the scale of the result is:
|
||||||
|
+min(a+b,max(scale,a,b))
|
||||||
|
.IP "expr / expr"
|
||||||
|
The result of the expression is the quotient of the two expressions.
|
||||||
|
The scale of the result is the value of the variable \fBscale\fR.
|
||||||
|
diff -up wrk/doc/bc.texi.wrk wrk/doc/bc.texi
|
||||||
|
--- wrk/doc/bc.texi.wrk 2013-10-02 13:17:01.743765518 +0200
|
||||||
|
+++ wrk/doc/bc.texi 2013-10-02 13:21:04.479870656 +0200
|
||||||
|
@@ -290,6 +290,8 @@ The result of the expression is the diff
|
||||||
|
|
||||||
|
@item expr * expr
|
||||||
|
The result of the expression is the product of the two expressions.
|
||||||
|
+If a and b are the scales of the two expressions, then the scale of the result is:
|
||||||
|
+min(a+b,max(@var{scale},a,b))
|
||||||
|
|
||||||
|
@item expr / expr
|
||||||
|
The result of the expression is the quotient of the two expressions.
|
||||||
16
bc.spec
16
bc.spec
@ -1,10 +1,12 @@
|
|||||||
Name: bc
|
Name: bc
|
||||||
Version: 1.07.1
|
Version: 1.07.1
|
||||||
Release: 12
|
Release: 9
|
||||||
Summary: An arbitrary precision numeric processing language.
|
Summary: An arbitrary precision numeric processing language.
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: http://www.gnu.org/software/bc/
|
URL: http://www.gnu.org/software/bc/
|
||||||
Source0: https://ftp.gnu.org/gnu/bc/%{name}-%{version}.tar.gz
|
Source0: https://ftp.gnu.org/gnu/bc/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: bc-1.06-dc_ibase.patch
|
||||||
|
Patch1: bc-1.06.95-doc.patch
|
||||||
|
|
||||||
BuildRequires: gcc readline-devel flex bison texinfo ed
|
BuildRequires: gcc readline-devel flex bison texinfo ed
|
||||||
Requires(post): info
|
Requires(post): info
|
||||||
@ -52,18 +54,6 @@ fi;
|
|||||||
%doc Examples/
|
%doc Examples/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Oct 25 2022 yanglongkang <yanglongkang@h-partners.com> - 1.07.1-12
|
|
||||||
- rebuild for next release
|
|
||||||
|
|
||||||
* Tue Aug 18 2020 chenyaqiang <chenyaqiang@huawei.com> - 1.07.1-11
|
|
||||||
- rebuild for package build
|
|
||||||
|
|
||||||
* Mon Jan 6 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.07.1-10
|
|
||||||
- Type:enhancement
|
|
||||||
- ID:NA
|
|
||||||
- SUG:NA
|
|
||||||
- DESC:delete redundant files
|
|
||||||
|
|
||||||
* Mon Oct 21 2019 shenyangyang <shenyangyang4@huawei.com> - 1.07.1-9
|
* Mon Oct 21 2019 shenyangyang <shenyangyang4@huawei.com> - 1.07.1-9
|
||||||
- Type:NA
|
- Type:NA
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user