Skip to content

Dr/fib switch to iterative#86

Merged
dr-frmr merged 3 commits intodevelopfrom
dr/fib-switch-to-iterative
Mar 8, 2024
Merged

Dr/fib switch to iterative#86
dr-frmr merged 3 commits intodevelopfrom
dr/fib-switch-to-iterative

Conversation

@dr-frmr
Copy link
Copy Markdown
Contributor

@dr-frmr dr-frmr commented Feb 19, 2024

Problem

Recursive fibonacci impl good for testing perf, bad for proving (which we wanna use this template for!)

Solution

Swap fib function to iterative

Docs Update

N/A

Notes

@dr-frmr dr-frmr requested a review from nick1udwig February 19, 2024 22:12
Copy link
Copy Markdown
Member

@nick1udwig nick1udwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a nit; otherwise LGTM 👍

} else {
trial - mean
}
}) / number_trials as u128;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The above was much more readable to me as the one-liner

ad + if mean >= trial { mean - trial } else { trial - mean }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustfmt automatically puts it on 4 lines :(

@dr-frmr dr-frmr merged commit 72bc282 into develop Mar 8, 2024
@dr-frmr dr-frmr deleted the dr/fib-switch-to-iterative branch March 8, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants