# Java Tutorial – 15 – Powers and Square Roots (Math Functions)

///Java Tutorial – 15 – Powers and Square Roots (Math Functions)
• ## Java Tutorial – 15 – Powers and Square Roots (Math Functions)  Add to favorites

Get more lessons like this at

Learn how to use the math functions in the java library to perform calculations and write complex code that require mathematical calculations. Here we learn about powers and square roots.

source

By |2020-12-19T11:14:21+00:00December 19th, 2020|Java Video Tutorials|6 Comments

### 6 Comments

1. 신촌우왕TV수학자.천재작곡가 December 19, 2020 at 11:14 am - Reply

# Copyright 2020. 신촌우왕TV수학자.천재작곡가 All rights reserved.
# 루트 2 = 1.41421356237309504880168872420969807856967187537694
# Python Code: 임의의 자연수에 대한 ROOT 값을 구하기
ROOT = 2 # ROOT 2의 값. 3으로 변경하면 ROOT 3의 값이 구해짐.
DIGIT = 50 # 소수점 아래 50자리까지 구하기

s = [0, ROOT, ""]

for i in range(DIGIT+1):
for a in range(10 + ROOT):
u = ((s)*10 + a)*a
v = ((s)*10 + a+1)*(a+1)

if u <= s and s < v:
s += str(a)

s = ((s)*10 + a) + a
s = (s – u) * 100

break

if i==0:
s += "."

# 계산 결과가 s에 들어있음.
print("루트 %d의 소수점 %d자리까지의 값:n%s"%(ROOT, DIGIT, s))
#print("Length: " , len(s))
# =====================================================
# 루트 2의 소수점 50자리까지의 값:
# 1.41421356237309504880168872420969807856967187537694

2. Besir Meral December 19, 2020 at 11:14 am - Reply

thank you man helped with my hw 🙂

3. Tushar Dixit December 19, 2020 at 11:14 am - Reply

I understood everything but i want integer …. Everytimes i got double as answer 🙁

4. Tushar Dixit December 19, 2020 at 11:14 am - Reply

if we want only integer as return then what should we do?

5. R D December 19, 2020 at 11:14 am - Reply

Another EXPLAINED VIDEO on MATH FUNCTIONS
https://youtu.be/zrf5k776uHY

6. Arvind pandey December 19, 2020 at 11:14 am - Reply

Thanks