mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
14 lines
281 B
Python
14 lines
281 B
Python
# Computing the Euclidian norm using the Pythagorean Theorem
|
|
|
|
from math import sqrt
|
|
|
|
def withPow(a, b):
|
|
return sqrt(a**2 + b**2) # $ Alert
|
|
|
|
def withMul(a, b):
|
|
return sqrt(a*a + b*b) # $ Alert
|
|
|
|
def withRef(a, b):
|
|
a2 = a**2
|
|
b2 = b*b
|
|
return sqrt(a2 + b2) # $ Alert |