One solution would be to set up an Epsilon equal to some magical small value and then check whether the absolute value of your result provided by a function is less (or less-or-equal) to your Epsilon.
(Naming it Epsilon is just a convention; it could be double MagicalNumberIndeed = VerySmallValue;)