Here is the original code for my function:
http://www.theswamp.org/index.php?topic=46438.msg514570#msg514570
Here is another implementation of the method:
http://www.theswamp.org/index.php?topic=45220.msg504240#msg504240
And here is the likely source of where you found the code in your post:
http://www.theswamp.org/index.php?topic=45700.msg508403#msg508403