aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2024-01-04 23:07:46 +0000
committerStefan Eßer <se@FreeBSD.org>2024-01-04 23:07:46 +0000
commit52a5ec1b178fd07651446c7e31b1512794a04dbf (patch)
tree62aa4228983c3d6444ffb87eab1781b6f2ec0e1f
parenta3f3a7b4dc80d577e4c8fc64dfbbb359d2e24228 (diff)
downloadsrc-vendor/bc.tar.gz
src-vendor/bc.zip
vendor/bc: upgrade to version 6.7.5vendor/bc
This update fixes a bug that line breaks in printed numbers may not match the line length set by the user. The value is printed correctly, just not split as specified in some situations.
-rw-r--r--NEWS.md9
-rw-r--r--include/bc.h2
-rw-r--r--include/history.h4
-rw-r--r--include/num.h6
-rw-r--r--include/version.h2
-rw-r--r--scripts/sqrt_frac_guess.bc126
-rw-r--r--scripts/sqrt_int_guess.bc94
-rw-r--r--scripts/sqrt_random.bc129
-rwxr-xr-xscripts/sqrt_random.sh77
-rw-r--r--src/num.c41
-rw-r--r--src/program.c4
-rw-r--r--tests/bc/scripts/all.txt1
-rw-r--r--tests/bc/scripts/print2.bc63
-rw-r--r--tests/bc/scripts/print2.txt650
-rw-r--r--tests/bc/sqrt.txt2
-rw-r--r--tests/bc/sqrt_results.txt2
-rw-r--r--vs/bc.vcxproj4
-rw-r--r--vs/bcl.vcxproj6
18 files changed, 1200 insertions, 22 deletions
diff --git a/NEWS.md b/NEWS.md
index 240e02f11388..32e74de31231 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,14 @@
# News
+## 6.7.5
+
+This is a production release to fix one small bug.
+
+The bug is that sometimes numbers are printed to incorrect line lengths. The
+number is always correct; the line is just longer than the limit.
+
+Users who do not care do not need to update.
+
## 6.7.4
This is a production release to fix problems in the `bc` manual.
diff --git a/include/bc.h b/include/bc.h
index 73a85aa406a0..17fd0b9d171f 100644
--- a/include/bc.h
+++ b/include/bc.h
@@ -276,7 +276,7 @@ bc_lex_token(BcLex* l);
* @return True if i is an expression token, false otherwise.
*/
#define BC_PARSE_EXPR(i) \
- (bc_parse_exprs[(((i) & (uchar) ~(0x07)) >> 3)] & (1 << (7 - ((i) &0x07))))
+ (bc_parse_exprs[(((i) & (uchar) ~(0x07)) >> 3)] & (1 << (7 - ((i) & 0x07))))
/**
* Returns the operator (by lex token) that is at the top of the operator
diff --git a/include/history.h b/include/history.h
index 19c5a0fe27f7..64402c4dffa1 100644
--- a/include/history.h
+++ b/include/history.h
@@ -173,10 +173,6 @@ typedef struct BcHistory
#include <vector.h>
#include <read.h>
-#if BC_DEBUG_CODE
-#include <file.h>
-#endif // BC_DEBUG_CODE
-
/// Default columns.
#define BC_HIST_DEF_COLS (80)
diff --git a/include/num.h b/include/num.h
index d24c206cbe51..6c9dee107f2f 100644
--- a/include/num.h
+++ b/include/num.h
@@ -211,9 +211,9 @@ struct BcRNG;
#define BC_NUM_KARATSUBA_ALLOCS (6)
/**
- * Rounds @a s (scale) up to the next power of BC_BASE_DIGS. This also check for
- * overflow and gives a fatal error if that happens because we just can't go
- * over the limits we have imposed.
+ * Rounds @a s (scale) up to the next power of BC_BASE_DIGS. This will also
+ * check for overflow and gives a fatal error if that happens because we just
+ * can't go over the limits we have imposed.
* @param s The scale to round up.
* @return @a s rounded up to the next power of BC_BASE_DIGS.
*/
diff --git a/include/version.h b/include/version.h
index d481cb10abf1..e2576269345d 100644
--- a/include/version.h
+++ b/include/version.h
@@ -37,6 +37,6 @@
#define BC_VERSION_H
/// The current version.
-#define VERSION 6.7.4
+#define VERSION 6.7.5
#endif // BC_VERSION_H
diff --git a/scripts/sqrt_frac_guess.bc b/scripts/sqrt_frac_guess.bc
new file mode 100644
index 000000000000..5938cfcc7cba
--- /dev/null
+++ b/scripts/sqrt_frac_guess.bc
@@ -0,0 +1,126 @@
+#! /usr/bin/bc
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2018-2023 Gavin D. Howard and contributors.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# * 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
+#
+
+scale = 20
+
+# Adjust this number to try ranges below different powers of 10.
+shift = 4
+
+# Adjust this to try extra digits. For example, a value of one means that one
+# digit is checked (such as 0.09 through 0.01), a value of two means that two
+# digits are checked (0.090 through 0.010), etc.
+max = shift + 2
+
+n = (9 >> shift)
+inc = (1 >> max)
+stop = (1 >> shift)
+
+# Uncomment this to test the high part of the ranges.
+#n += (1 - (1 >> max + 5)) >> shift
+
+for (i = n; i >= stop; i -= inc)
+{
+ # This is the lower limit.
+ t1 = sqrt(1/(3*i))
+
+ # Start with the inverse.
+ t2 = (1/i)
+
+ # And take half its length of course.
+ l = length(t2$)/2
+
+ temp = i
+ odd = 0
+
+ # We go by powers of 10 below, but there is a degenerate case: an exact
+ # power of 10, for which length() will return one digit more. So we check
+ # for that and fix it.
+ while (temp < 1)
+ {
+ temp <<= 1
+ odd = !odd
+ }
+
+ if (temp == 1)
+ {
+ odd = !odd
+ }
+
+ print "i: ", i, "\n"
+ print "t2: ", t2, "\n"
+ #print "l: ", l, "\n"
+ print "odd: ", odd, "\n"
+
+ if (odd)
+ {
+ # Limit between 6 and 7.5.
+ limit1 = 6.7 >> (l$ * 2 + 1)
+
+ # Limit between 1.5 and 1.83-ish.
+ limit2 = 1.7 >> (l$ * 2 + 1)
+ print "limit1: ", limit1, "\n"
+ print "limit2: ", limit2, "\n"
+
+ if (i >= limit1)
+ {
+ t2 = (t2 >> l$)
+ }
+ else if (i >= limit2)
+ {
+ t2 = (t2 >> l$) / 2
+ }
+ else
+ {
+ t2 = (t2 >> l$) / 4
+ }
+ }
+ else
+ {
+ # Limit between 2.4 and 3.
+ limit = 2.7 >> (l$ * 2)
+ print "limit: ", limit, "\n"
+
+ if (i >= limit)
+ {
+ t2 = (t2 >> l$) * 2
+ }
+ else
+ {
+ t2 = (t2 >> l$)
+ }
+ }
+ #t2 = 1
+ t3 = sqrt(5/(3*i))
+ good = (t1 < t2 && t2 < t3)
+
+ print t1, " < ", t2, " < ", t3, ": ", good, "\n\n"
+ if (!good) sqrt(-1)
+}
+
+halt
diff --git a/scripts/sqrt_int_guess.bc b/scripts/sqrt_int_guess.bc
new file mode 100644
index 000000000000..551a06eb2e6d
--- /dev/null
+++ b/scripts/sqrt_int_guess.bc
@@ -0,0 +1,94 @@
+#! /usr/bin/bc -l
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2018-2023 Gavin D. Howard and contributors.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# * 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
+#
+
+# Adjust this number to try ranges above different powers of 10.
+max = 0
+
+n = (1 << max)
+
+# Uncomment this to test the high part of the ranges.
+#n += (1 - (1 >> 10))
+
+n
+
+# Loop from the start number to the next power of 10.
+for (i = n; i < (n$ << 1); i += 1)
+{
+ # This is the lower limit.
+ t1 = sqrt(1/(3*i))
+
+ l = length(i$)/2
+
+ print "i: ", i, "\n"
+ #print "l: ", l, "\n"
+
+ if (l$ != l)
+ {
+ # Limit between 2.4 and 3.
+ limit = 2.7 << (l$ * 2)
+ #print "limit: ", limit, "\n"
+
+ if (i >= limit)
+ {
+ t2 = 1/(i >> (l$)) * 2
+ }
+ else
+ {
+ t2 = 1/(i >> (l$))
+ }
+ }
+ else
+ {
+ # Limit between 3.8-ish and 4.8
+ limit = 4.3 << (l$ * 2 - 1)
+ #print "limit: ", limit, "\n"
+
+ if (i >= limit)
+ {
+ t2 = 1/(i >> (l$ - 1)) * 8
+ }
+ else
+ {
+ t2 = 1/(i >> (l$ - 1)) * 4
+ }
+ }
+
+ # This is the upper limit.
+ t3 = sqrt(5/(3*i))
+
+ # This is true when the guess is in between the limits.
+ good = (t1 < t2 && t2 < t3)
+
+ print t1, " < ", t2, " < ", t3, ": ", good, "\n"
+
+ # Error if we have a problem.
+ if (!good) sqrt(-1)
+}
+
+halt
diff --git a/scripts/sqrt_random.bc b/scripts/sqrt_random.bc
new file mode 100644
index 000000000000..ff08348f4977
--- /dev/null
+++ b/scripts/sqrt_random.bc
@@ -0,0 +1,129 @@
+#! /usr/bin/bc
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2018-2023 Gavin D. Howard and contributors.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# * 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
+#
+
+scale = 0
+
+bits = rand()
+
+# This extracts a bit and takes it out of the original value.
+#
+# Here, I am getting a bit to say whether we should have a value that is less
+# than 1.
+bits = divmod(bits, 2, negpow[])
+
+# Get a bit that will say whether the value should be an exact square.
+bits = divmod(bits, 2, square[])
+
+# See below. This is to help bias toward small numbers.
+pow = 4
+
+# I want to bias toward small numbers, so let's give a 50 percent chance to
+# values below 16 or so.
+bits = divmod(bits, 2, small[])
+
+# Let's keep raising the power limit by 2^4 when the bit is zero.
+while (!small[0])
+{
+ pow += 4
+ bits = divmod(bits, 2, small[])
+}
+
+limit = 2^pow
+
+# Okay, this is the starting number.
+num = irand(limit) + 1
+
+# Figure out if we should have (more) fractional digits.
+bits = divmod(bits, 2, extra_digits[])
+
+if (square[0])
+{
+ # Okay, I lied. If we need a perfect square, square now.
+ num *= num
+
+ # If we need extra digits, we need to multiply by an even power of 10.
+ if (extra_digits[0])
+ {
+ extra = (irand(8) + 1) * 2
+ }
+ else
+ {
+ extra = 0
+ }
+
+ # If we need a number less than 1, just take the inverse, which will still
+ # be a perfect square.
+ if (negpow[0])
+ {
+ scale = length(num) + 5
+ num = 1/num
+ scale = 0
+
+ num >>= extra
+ }
+ else
+ {
+ num <<= extra
+ }
+}
+else
+{
+ # Get this for later.
+ l = length(num)
+
+ # If we need extra digits.
+ if (extra_digits[0])
+ {
+ # Add up to 32 decimal places.
+ num += frand(irand(32) + 1)
+ }
+
+ # If we need a value less than 1...
+ if (negpow[0])
+ {
+ # Move right until the number is
+ num >>= l
+ }
+}
+
+bits = divmod(bits, 2, zero_scale[])
+
+# Do we want a zero scale?
+if (zero_scale[0])
+{
+ print "scale = 0\n"
+}
+else
+{
+ print "scale = 20\n"
+}
+
+print "sqrt(", num, ")\n"
+
+halt
diff --git a/scripts/sqrt_random.sh b/scripts/sqrt_random.sh
new file mode 100755
index 000000000000..694c72003192
--- /dev/null
+++ b/scripts/sqrt_random.sh
@@ -0,0 +1,77 @@
+#! /bin/sh
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2018-2023 Gavin D. Howard and contributors.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# * 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
+#
+
+scriptdir=$(dirname "$0")
+
+gnu=/usr/bin/bc
+gdh=/usr/local/bin/bc
+
+if [ "$#" -lt 1 ]; then
+ printf 'err: must provide path to new bc\n'
+ exit 1
+fi
+
+new="$1"
+shift
+
+unset BC_LINE_LENGTH && unset BC_ENV_ARGS
+
+gdh_fail_file="sqrt_fails.bc"
+new_fail_file="new_sqrt_fails.bc"
+
+rm -rf "$gdh_fail_file"
+rm -rf "$new_fail_file"
+
+while [ true ]; do
+
+ tst=$("$gdh" -l "$scriptdir/sqrt_random.bc")
+ err=$?
+
+ if [ "$err" -ne 0 ]; then
+ printf 'err: failed to create test\n'
+ exit 2
+ fi
+
+ good=$(printf '%s\n' "$tst" | "$gnu" -l)
+
+ gdh_out=$(printf '%s\n' "$tst" | "$gdh" -l)
+ new_out=$(printf '%s\n' "$tst" | "$new" -l)
+
+ gdh_good=$(printf '%s == %s\n' "$good" "$gdh_out" | "$gnu")
+ new_good=$(printf '%s == %s\n' "$good" "$new_out" | "$gnu")
+
+ if [ "$gdh_good" -eq 0 ]; then
+ printf '%s\n' "$tst" >> "$gdh_fail_file"
+ fi
+
+ if [ "$new_good" -eq 0 ]; then
+ printf '%s\n' "$tst" >> "$new_fail_file"
+ fi
+
+done
diff --git a/src/num.c b/src/num.c
index e45aa62ddd0f..ac0f828008f8 100644
--- a/src/num.c
+++ b/src/num.c
@@ -3207,12 +3207,30 @@ bc_num_printNum(BcNum* restrict n, BcBigDig base, size_t len,
assert(ptr != NULL);
// While the first three arguments should be self-explanatory, the last
- // needs explaining. I don't want to print a newline when the last digit
- // to be printed could take the place of the backslash rather than being
- // pushed, as a single character, to the next line. That's what that
- // last argument does for bc.
+ // needs explaining. I don't want to print a backslash+newline when the
+ // last digit to be printed could take the place of the backslash rather
+ // than being pushed, as a single character, to the next line. That's
+ // what that last argument does for bc.
+ //
+ // First, it needs to check if newlines are completely disabled. If they
+ // are not disabled, it needs to check the next part.
+ //
+ // If the number has a scale, then because we are printing just the
+ // integer part, there will be at least two more characters (a radix
+ // point plus at least one digit). So if there is a scale, a backslash
+ // is necessary.
+ //
+ // Finally, the last condition checks to see if we are at the end of the
+ // stack. If we are *not* (i.e., the index is not one less than the
+ // stack length), then a backslash is necessary because there is at
+ // least one more character for at least one more digit). Otherwise, if
+ // the index is equal to one less than the stack length, we want to
+ // disable backslash printing.
+ //
+ // The function that prints bases 17 and above will take care of not
+ // printing a backslash in the right case.
print(*ptr, len, false,
- !newline || (n->scale != 0 || i == stack.len - 1));
+ !newline || (n->scale != 0 || i < stack.len - 1));
}
// We are done if there is no fractional part.
@@ -4091,13 +4109,14 @@ bc_num_sqrt(BcNum* restrict a, BcNum* restrict b, size_t scale)
// Square root needs half of the length of the parameter.
req = bc_vm_growSize(BC_MAX(rdx, BC_NUM_RDX_VAL(a)), len >> 1);
+ req = bc_vm_growSize(req, 1);
BC_SIG_LOCK;
// Unlike the binary operators, this function is the only single parameter
// function and is expected to initialize the result. This means that it
// expects that b is *NOT* preallocated. We allocate it here.
- bc_num_init(b, bc_vm_growSize(req, 1));
+ bc_num_init(b, req);
BC_SIG_UNLOCK;
@@ -4130,13 +4149,12 @@ bc_num_sqrt(BcNum* restrict a, BcNum* restrict b, size_t scale)
bc_num_init(&num2, len);
bc_num_setup(&half, half_digs, sizeof(half_digs) / sizeof(BcDig));
- // There is a division by two in the formula. We setup a number that's 1/2
+ // There is a division by two in the formula. We set up a number that's 1/2
// so that we can use multiplication instead of heavy division.
- bc_num_one(&half);
+ bc_num_setToZero(&half, 1);
half.num[0] = BC_BASE_POW / 2;
half.len = 1;
BC_NUM_RDX_SET_NP(half, 1);
- half.scale = 1;
bc_num_init(&f, len);
bc_num_init(&fprime, len);
@@ -4156,8 +4174,9 @@ bc_num_sqrt(BcNum* restrict a, BcNum* restrict b, size_t scale)
pow = bc_num_intDigits(a);
// The code in this if statement calculates the initial estimate. First, if
- // a is less than 0, then 0 is a good estimate. Otherwise, we want something
- // in the same ballpark. That ballpark is pow.
+ // a is less than 1, then 0 is a good estimate. Otherwise, we want something
+ // in the same ballpark. That ballpark is half of pow because the result
+ // will have half the digits.
if (pow)
{
// An odd number is served by starting with 2^((pow-1)/2), and an even
diff --git a/src/program.c b/src/program.c
index 2f26589166e3..c9d268dfde82 100644
--- a/src/program.c
+++ b/src/program.c
@@ -3780,7 +3780,7 @@ bc_program_printStr(const BcProgram* p, const char* restrict code,
size_t idx = bc_program_index(code, bgn);
char* s;
- s = *((char**) bc_vec_item(p->strs, idx));
+ s = *((char**) bc_vec_item(&p->strs, idx));
bc_vm_printf(" (\"%s\") ", s);
}
@@ -3803,7 +3803,7 @@ bc_program_printInst(const BcProgram* p, const char* restrict code,
else if (inst == BC_INST_NUM)
{
size_t idx = bc_program_index(code, bgn);
- BcConst* c = bc_vec_item(p->consts, idx);
+ BcConst* c = bc_vec_item(&p->consts, idx);
bc_vm_printf("(%s)", c->val);
}
else if (inst == BC_INST_CALL ||
diff --git a/tests/bc/scripts/all.txt b/tests/bc/scripts/all.txt
index 0008d70193c6..7b49f7c4e77a 100644
--- a/tests/bc/scripts/all.txt
+++ b/tests/bc/scripts/all.txt
@@ -3,6 +3,7 @@ divide.bc
subtract.bc
add.bc
print.bc
+print2.bc
parse.bc
root.bc
array.bc
diff --git a/tests/bc/scripts/print2.bc b/tests/bc/scripts/print2.bc
new file mode 100644
index 000000000000..5f3466929f77
--- /dev/null
+++ b/tests/bc/scripts/print2.bc
@@ -0,0 +1,63 @@
+#! /usr/bin/bc -q
+
+l = line_length()
+
+max = 128
+scale = 0
+
+obase=2
+2^99
+2^100
+2^105
+
+for (i = 2; i < max; ++i)
+{
+ obase=i
+ if (obase < 17)
+ {
+ 1 * i^(l - 1)
+ 1 * i^l
+ 1 * i^(l + 1)
+ }
+ else if (obase >= 17 && obase <= 100)
+ {
+ l2 = l/3
+ 1 * i^(l2 - 1)
+ 1 * i^l2
+ 1 * i^(l2 + 1)
+ }
+ else
+ {
+ l2 = l/4
+ 1 * i^(l2 - 1)
+ 1 * i^l2
+ 1 * i^(l2 + 1)
+ }
+}
+
+if (maxobase() > 2^18)
+{
+ obase=2^18
+ 1 * i^(100)
+ 1 * i^(101)
+ 1 * i^(103)
+}
+else
+{
+ print " 065536 000000 000000 000000 000000 000000 000000 000000 000000 0000\\\n"
+ print "00 000000 000000 000000 000000 000000 000000 000000 000000 000000 00\\\n"
+ print "0000 000000 000000 000000 000000 000000 000000 000000 000000 000000 \\\n"
+ print "000000 000000 000000 000000 000000 000000 000000 000000 000000 000000\n"
+ print " 000032 000000 000000 000000 000000 000000 000000 000000 000000 0000\\\n"
+ print "00 000000 000000 000000 000000 000000 000000 000000 000000 000000 00\\\n"
+ print "0000 000000 000000 000000 000000 000000 000000 000000 000000 000000 \\\n"
+ print "000000 000000 000000 000000 000000 000000 000000 000000 000000 00000\\\n"
+ print "0 000000\n"
+ print " 000002 000000 000000 000000 000000 000000 000000 000000 000000 0000\\\n"
+ print "00 000000 000000 000000 000000 000000 000000 000000 000000 000000 00\\\n"
+ print "0000 000000 000000 000000 000000 000000 000000 000000 000000 000000 \\\n"
+ print "000000 000000 000000 000000 000000 000000 000000 000000 000000 00000\\\n"
+ print "0 000000 000000\n"
+}
+
+halt
diff --git a/tests/bc/scripts/print2.txt b/tests/bc/scripts/print2.txt
new file mode 100644
index 000000000000..208f0ed2e479
--- /dev/null
+++ b/tests/bc/scripts/print2.txt
@@ -0,0 +1,650 @@
+10000000000000000000000000000000000000000000000000000000000000000000\
+00000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00000000000000000000000000000000000000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+100000000000000000000000000000000000000000000000000000000000000000000
+10000000000000000000000000000000000000000000000000000000000000000000\
+00
+10000000000000000000000000000000000000000000000000000000000000000000\
+000
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00
+ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0\
+0 00 00
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000
+ 001 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000\
+ 000 000
+ 065536 000000 000000 000000 000000 000000 000000 000000 000000 0000\
+00 000000 000000 000000 000000 000000 000000 000000 000000 000000 00\
+0000 000000 000000 000000 000000 000000 000000 000000 000000 000000 \
+000000 000000 000000 000000 000000 000000 000000 000000 000000 000000
+ 000032 000000 000000 000000 000000 000000 000000 000000 000000 0000\
+00 000000 000000 000000 000000 000000 000000 000000 000000 000000 00\
+0000 000000 000000 000000 000000 000000 000000 000000 000000 000000 \
+000000 000000 000000 000000 000000 000000 000000 000000 000000 00000\
+0 000000
+ 000002 000000 000000 000000 000000 000000 000000 000000 000000 0000\
+00 000000 000000 000000 000000 000000 000000 000000 000000 000000 00\
+0000 000000 000000 000000 000000 000000 000000 000000 000000 000000 \
+000000 000000 000000 000000 000000 000000 000000 000000 000000 00000\
+0 000000 000000
diff --git a/tests/bc/sqrt.txt b/tests/bc/sqrt.txt
index afd87ff0f6e6..f0d79a188290 100644
--- a/tests/bc/sqrt.txt
+++ b/tests/bc/sqrt.txt
@@ -1,5 +1,7 @@
scale = 20
sqrt(0)
+sqrt(1)
+sqrt(1.00000000000)
sqrt(2)
sqrt(4)
sqrt(9)
diff --git a/tests/bc/sqrt_results.txt b/tests/bc/sqrt_results.txt
index 10a4fa95d5a5..8ce821f1fb49 100644
--- a/tests/bc/sqrt_results.txt
+++ b/tests/bc/sqrt_results.txt
@@ -1,4 +1,6 @@
0
+1.00000000000000000000
+1.00000000000000000000
1.41421356237309504880
2.00000000000000000000
3.00000000000000000000
diff --git a/vs/bc.vcxproj b/vs/bc.vcxproj
index 312af50e8a66..377eb8645a71 100644
--- a/vs/bc.vcxproj
+++ b/vs/bc.vcxproj
@@ -100,6 +100,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=1;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;BC_ENABLE_EDITLINE=0;BC_ENABLE_READLINE=0;BUILD_TYPE=N;BC_DEFAULT_BANNER=1;BC_DEFAULT_SIGINT_RESET=0;DC_DEFAULT_SIGINT_RESET=0;BC_DEFAULT_TTY_MODE=1;DC_DEFAULT_TTY_MODE=1;BC_DEFAULT_PROMPT=1;DC_DEFAULT_PROMPT=1;BC_DEFAULT_EXPR_EXIT=1;DC_DEFAULT_EXPR_EXIT=1;BC_DEFAULT_DIGIT_CLAMP=1;DC_DEFAULT_DIGIT_CLAMP=1;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -119,6 +120,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -142,6 +144,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=1;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=0;BC_ENABLE_EDITLINE=0;BC_ENABLE_READLINE=0;BUILD_TYPE=N;BC_DEFAULT_BANNER=1;BC_DEFAULT_SIGINT_RESET=0;DC_DEFAULT_SIGINT_RESET=0;BC_DEFAULT_TTY_MODE=1;DC_DEFAULT_TTY_MODE=1;BC_DEFAULT_PROMPT=1;DC_DEFAULT_PROMPT=1;BC_DEFAULT_EXPR_EXIT=1;DC_DEFAULT_EXPR_EXIT=1;BC_DEFAULT_DIGIT_CLAMP=1;DC_DEFAULT_DIGIT_CLAMP=1;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -161,6 +164,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
diff --git a/vs/bcl.vcxproj b/vs/bcl.vcxproj
index a8de10e9f10b..f838cac7cbd1 100644
--- a/vs/bcl.vcxproj
+++ b/vs/bcl.vcxproj
@@ -130,6 +130,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -143,6 +144,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMD|Win32'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -160,6 +162,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|Win32'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -178,6 +181,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>BC_ENABLED=1;DC_ENABLED=1;BC_ENABLE_EXTRA_MATH=1;BC_ENABLE_HISTORY=0;BC_ENABLE_NLS=0;BC_DEBUG_CODE=0;BC_ENABLE_LIBRARY=1;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -191,6 +195,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMD|x64'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -208,6 +213,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseMT|x64'">
<ClCompile>
+ <AdditionalOptions>/std:c17 /MP $(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>