Skip to content

Commit 37606b4

Browse files
committed
various small fixes
1 parent 597a6be commit 37606b4

File tree

6 files changed

+13
-896
lines changed

6 files changed

+13
-896
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ To install or update LODA, please follow the [installation instructions](https:/
22

33
## [Unreleased]
44

5+
### Bugfixes
6+
7+
* Fix error message in `check` command
8+
59
### Enhancements
610

711
* Improve handling of loops with constant number of iterations
812
* Improve detection of fake "better" programs
13+
* Disable incremental evaluation in `check` command for consistency
14+
* Adjust maximum big int size to handle A000336
915

1016
# v22.6.19
1117

src/commands.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ void Commands::check(const std::string& path) {
143143
}
144144
Evaluator evaluator(settings);
145145
auto terms = seq.getTerms(OeisSequence::FULL_SEQ_LENGTH);
146-
auto result =
147-
evaluator.check(program, terms, OeisSequence::DEFAULT_SEQ_LENGTH, seq.id);
146+
// don't use incremental evaluation in maintenance to detect bugs
147+
auto result = evaluator.check(
148+
program, terms, OeisSequence::DEFAULT_SEQ_LENGTH, seq.id, false);
148149
switch (result.first) {
149150
case status_t::OK:
150151
std::cout << "ok" << std::endl;

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ int dispatch(Settings settings, const std::vector<std::string>& args) {
140140
Log::get().error("Option -s only allowed in evaluate command", true);
141141
}
142142
if (settings.print_as_b_file && cmd != "evaluate" && cmd != "eval" &&
143-
cmd != "check" && cmd != "maintain") {
143+
cmd != "check") {
144144
Log::get().error("Option -b not allowed for this command", true);
145145
}
146146
if (settings.parallel_mining && cmd != "mine") {

src/oeis_sequence.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ bool OeisSequence::isTooBig(const Number& n) {
2323
return true;
2424
}
2525
if (USE_BIG_NUMBER) {
26-
return n.getNumUsedWords() > static_cast<int64_t>(BigNumber::NUM_WORDS / 2);
26+
return n.getNumUsedWords() >
27+
static_cast<int64_t>(BigNumber::NUM_WORDS / 4); // magic number
2728
} else {
2829
static const int64_t NUM_INF = std::numeric_limits<int64_t>::max();
2930
return (n.value > (NUM_INF / 1000)) || (n.value < (NUM_INF / -1000));

tests/programs/oeis/full_check.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A000572: A Beatty sequence: [ n(e+1) ].

0 commit comments

Comments
 (0)