Skip to content

Instantly share code, notes, and snippets.

@spiridenok
spiridenok / gist:6154707
Created August 5, 2013 09:46
VBA: replace last occurrence of a string within a string
' replace only the LAST occurrence of a the SEARCH substring in SOURCE
' with the REPLACESTR string - search isn't case-sensitive
ReplaceLast = StrReverse(Replace(StrReverse(Source), StrReverse(Search), StrReverse(ReplaceStr), , 1))
@spiridenok
spiridenok / fast_sqrt
Created July 29, 2013 10:53
Fast SQRT
static double fast_sqrt( const double number )
{
const double f = 1.5;
const double x = number * 0.5;
double y = number;
union
{
double *double_repr;
long long *long_long_repr;