Follow

int main() {

float x, y, z;

for (x=0, y=1, z=y; x<y; y+=z);

printf("%f\n", x);

}

@mxsparks I sm powerfully confused, in a fun way

@mxsparks

ghci> round $ until (ap (==) succ) succ (0 :: Float)

16777216

@mxsparks this rust is … not good

fn f(x: &mut f32, brk: Option<&()>) -> Option<()> {

loop {

if *x == 1.0 + *x {

brk?;

}

*x += 1.0;

}

}

fn run(x: &mut f32) {

f(x, [].first());

println!("{}", x);

}

fn main() {

run(&mut 0f32);

}

@velartrill @mxsparks i did try tail calls at first but 16 million tail calls is too tall

@rockario "add 1 to y until y stops going up, using x to hold 'old y'"

https://quicklatex.com/cache3/df/ql_7cc85d41ccb10f73704a8d6b1bac91df_l3.png

(I think I get the joke, anyway)

@mxsparks 1, 2, 3, ad infinitum?

@shoofle not with floats! you can only go as high as your significand's width

@mxsparks ohhh, how cool! I didn't catch that it's using floats.

clara "lipogrammatic" sparks@mxsparks@oulipo.socialthus proving:

\[ \sum _{n=0} ^\infty 1 = 16777216 \]