]> OCCT Git - occt.git/commit
Coding - Introduce compile-time sqrt constants and use them consistently (#789)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Sat, 1 Nov 2025 13:57:11 +0000 (13:57 +0000)
committerGitHub <noreply@github.com>
Sat, 1 Nov 2025 13:57:11 +0000 (13:57 +0000)
commitc88c05399f38f0a9e5892e97ed4a6976fe999612
tree12ee4d317a5d7ca344bf0481ad071063ac7e5d67
parentc640cafb8ba289a7e4aec5bf793de1cad62c96f7
Coding - Introduce compile-time sqrt constants and use them consistently (#789)

- Add M_SQRT2 macro in multiple sources and replace runtime sqrt/Sqrt(2) calls with the macro
- Add SQRT_3 constexpr in IGESGraph_Color and Bnd_OBB and replace Sqrt(3) usages
- Make BSplSLib_zero a constexpr array
- Replace a few computed sqrt literals with compile-time constants for clarity and consistency
12 files changed:
src/DataExchange/TKDEIGES/IGESGraph/IGESGraph_Color.cxx
src/Draw/TKDraw/Draw/Draw_GraphicCommands.cxx
src/Draw/TKQADraw/QABugs/QABugs_13.cxx
src/FoundationClasses/TKMath/BSplSLib/BSplSLib.cxx
src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx
src/FoundationClasses/TKMath/GTests/math_NewtonFunctionSetRoot_Test.cxx
src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx
src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx
src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Fuse_Test.cxx
src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCC.gxx
src/Visualization/TKOpenGl/OpenGl/OpenGl_BackgroundArray.cxx
src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx