I’m working on something which will involve calculating a lot of distances – so comparing sums of squares to squares of other things. I’ve noticed that Krister Fundin’s Numbers includes a pre-rolled function for calculating the square, but performance might be a big deal for me. Would it be faster to use his extension or to roll my own definition for the square of a number?
If squaring is all you’re doing, I don’t see any reason to use an extension. Rolling your own is literally as simple as “to decide what number is X (a number) squared: decide on X * X”. And Inform has a built in square root (“square root of”), so you don’t need an extension for that either.
Thanks! And now that I think of it, the distance calculations will probably be the least of my performance worries.