MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / hypot

Method hypot

Examples/NoModules/Appendix A/ExA_11/Hypot.cpp:8–8  ·  view source on GitHub ↗

Caution: See Chapter 11 for why you should always use std::hypot() over this na�ve definition (based on the Pythagorean Theorem)!

Source from the content-addressed store, hash-verified

6// Caution: See Chapter 11 for why you should always use std::hypot()
7// over this na�ve definition (based on the Pythagorean Theorem)!
8double math::hypot(double x, double y) { return std::sqrt(square(x) + square(y)); }

Callers

nothing calls this directly

Calls 1

squareFunction · 0.70

Tested by

no test coverage detected