aboutsummaryrefslogtreecommitdiff
path: root/contrib/bc/benchmarks/bc/constants.bc
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2022-03-07 22:23:56 +0000
committerStefan Eßer <se@FreeBSD.org>2022-03-07 22:26:09 +0000
commit23210c9f42af94dc6bcdae3996d8a3d010dd6bfe (patch)
tree642ba6c5d4d5e02e1fe7890192458bcc0ea9c1e2 /contrib/bc/benchmarks/bc/constants.bc
parent9282f04ff0ee89cc4064e510f7fa505cfc890bf0 (diff)
parent3673adf1ee311d6f83176d3e43cf0efb314764e4 (diff)
downloadsrc-23210c9f42af94dc6bcdae3996d8a3d010dd6bfe.tar.gz
src-23210c9f42af94dc6bcdae3996d8a3d010dd6bfe.zip
contrib/bc: update to version 5.2.3
This version fixes a parse error when passing a file to bc using -f if that file has a multiline comment or string in it. Merge commit '3673adf1ee311d6f83176d3e43cf0efb314764e4' MFC after: 3 days
Diffstat (limited to 'contrib/bc/benchmarks/bc/constants.bc')
-rw-r--r--contrib/bc/benchmarks/bc/constants.bc41
1 files changed, 41 insertions, 0 deletions
diff --git a/contrib/bc/benchmarks/bc/constants.bc b/contrib/bc/benchmarks/bc/constants.bc
new file mode 100644
index 000000000000..1f7b92d47566
--- /dev/null
+++ b/contrib/bc/benchmarks/bc/constants.bc
@@ -0,0 +1,41 @@
+#! /usr/bin/bc
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2018-2021 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.
+#
+
+max = 1000
+max2 = 1000
+
+for (i = 0; i < max; ++i) {
+
+ print "c = ", i, "\n"
+ print "e = 0.", i, "\n"
+
+ for (j = 0; j < max2; ++j) {
+ print "d = ", i, ".", j, "\n"
+ }
+}