NestWhile
Applies a function repeatedly while a test on the current value holds.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
NestWhile✓NestWhile(f, x, test)Applies to repeatedly while of the CURRENT value reads , and returns the first value where it doesn't.NestWhile(f, x, test, m) is called on the last values as separate arguments, instead of the bare current value.NestWhile(f, x, test, m, max)Additionally caps the number of -applications at .Typed signatures
| Type | Package | Applies |
|---|---|---|
(any, any, any, integer?, integer?) -> any | combinatorics | always |
Details
- With , the test waits until values exist, so runs times before the first test.
- Capped at 4096 applications of regardless of — see While.
Examples
Basic #
About
| Examples | 11 |
|---|---|
| Checked against | Wolfram Language 11 agree |
| Crosswalk | Wolfram Language |
See also: NestWhileList, While, FixedPointList