// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Creation Date: August 7 1998 // // // // // int equivalent(float $a, float $b) // // // Compare 2 float values within the current linear tolerance value. // // // float $a First value to compare // float $b Value to compare with // // // int : 1 if values are within linear tolerance values // // // tolerance -q -l; // // Result : 0.001 // // equivalent(0.0, 0.0005); // // Result : 1 // // equivalent(0.0, 0.005); // // Result : 0 // // // global proc int equivalent( float $a, float $b ) { float $tolerance = `tolerance -q -l`; return( abs($a - $b) <= $tolerance); }