Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 2528

programming • Re: Weekend coding challenge: Squares, cubes, and differences

$
0
0
Sorry, I didn't mean anything, just riffing on von Neumann's “Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin.”

It's a nice idea to use an arbitrary precision integer calculation to check. For this particular challenge, especially now that we can all see we don't need cube roots, a port to assembly with longer integers mightn't be too difficult. Although we do now have a description of a parameterised approach to all solutions (if only we could understand it... I know I don't.)

It's interesting - as you found - that the Beeb's floating point can get us a little further than integers, without missing anything, and I think the reason is that the solutions have some powers of two in their factorisations, so we have trailing zeros on our side. And really rather interesting that Z80 second processor basic gets a little further.

Might be worth reminding ourselves, too, that modern BBC Basic has more floating precision on Intel (and emulated Intel) than it does on ARM.

Statistics: Posted by BigEd — Tue Feb 25, 2025 8:06 am



Viewing all articles
Browse latest Browse all 2528

Trending Articles