Garry's Mod Wiki

Revision Difference

math.IsNearlyEqual#563320

<cat>libraryfunc</cat>⤶ <function name="IsNearlyEqual" parent="math" type="libraryfunc">⤶ <description>Checks if two floating point numbers are nearly equal.</description>⤶ <realm>Shared and Menu</realm>⤶ <added>2025.01.22</added>⤶ <file line="275-L281">lua/includes/extensions/math.lua</file>⤶ <args>⤶ <arg name="a" type="number">The first number to compare.</arg>⤶ <arg name="b" type="number">The second number to compare.</arg>⤶ <arg name="tolerance" type="number" default="1e-8">The maximum difference between the two numbers to consider them equal.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="boolean">True if the difference between the two numbers is less than or equal to the tolerance.</ret>⤶ </rets>⤶ </function>