What you're seeing is the accumulating rounding error that comes from using
a single. Floating types are *always* subject to some element of
imprecision. On my machine the function works exactly as expected up to 221,
after which a superfluous 0.0000000000001 creeps in. This is not unexpected.
Use the Format$() function to display the required level of precision, and
do some research on programming with floats -- this is a basic issue you
have to deal with in any programming language.
This shortcoming with VBA singles is well-documented, to the point that
it's hard to see any justification for ever using this data type.
> I have just debugged various errors in a program for Word as due to VBA's
> apparent inability to perform simple arithmetic. A simple piece of code such
[quoted text clipped - 8 lines]
> seems to make no difference - same with Double, anyway).
> What is going on?