wsq10

--Originally published at Tomas Enciso

Now this is a function that gets the square root of a number that the user inputs and by using the babylonian method.

Screen Shot 2017-05-04 at 7.04.09 AM

Screen Shot 2017-05-04 at 7.04.40 AM

For the first run I used a number that we all now the root of, 4 and the function returned 2 and for the second run a tried 50.5 and returned that float number.


#WSQ10 – Babylonian Method

--Originally published at マルコ

Background

In this assignment you will write a function to calculate the square root of a number using the Babylonian method. You can search for that method, it will be easy to find.

What to Do

The function should receive a number and return floating point number. Obviously you should test your function, so create a main program that asks the user a value, calculates the square root and displays that.

10.1

10.2


WSQ10 – Babylonian Method

--Originally published at Programming

Hello!

This week we have this instructions: In this assignment you will write a function to calculate the square root of a number using the Babylonian method. The function should receive a number and return floating point number.

First of all, we should know what the Babylonian method is. I could recommend visit Wikipedia or this video too: Solving Square Roots: Babylonian Method

Ok, now…

Here is the code:

Captura de pantalla 2017-04-27 a la(s) 13.43.32

And it runs like this:

Captura de pantalla 2017-04-27 a la(s) 13.43.59

Hope it helps ?


Babylonian Method!

--Originally published at Python learning

Last week the teacher gave us another problem to work on. As the title suggests, we had to create a function that would return the approximate square root of a number, using the Babylonian Method.

First I had to understand exactly how  the method works, so I watched this video:

However, I still didn’t understand how I would know when it was accurate enough. My classmate Elu explained it to me, telling me that it should be when the difference between two successive answers gotten from the formula differed only by 0.0001 or less.

Having fully understood the mathematics, I proceeded to write my code:

babylonianbabylonian_run


WSQ10

--Originally published at Program

?

In this assignment you will write a function to calculate the square root of a number using the Babylonian method.

Step 1: Make a guess.

Step 2: Divide your original number by your guess.

Step 3: Find the average of these numbers.

Step 4: Use this average as your next guess.

REPEAT THE PROCESS THREE TIMES.

What to Do

The function should receive a number and return floating point number. Obviously you should test your function, so create a main program that asks the user a value, calculates the square root and displays that.

Picture credit:

Babylonian Fresco flickr photo by Brimley shared under a Creative Commons (BY-NC) license


WSQ10 – Babylonian Method

--Originally published at Elu's Blog

For this assignment, these were my instructions:

In this assignment you will write a function to calculate the square root of a number using the Babylonian method. You can search for that method, it will be easy to find.

The function should receive a number and return floating point number. Obviously you should test your function, so create a main program that asks the user a value, calculates the square root and displays that.

This is what I came up with:

Captura de pantalla 2017-03-30 a la(s) 18.38.32.png

And this is how it runs:

Captura de pantalla 2017-03-30 a la(s) 18.39.29.png


WSQ-10

--Originally published at Héctor Santillán

Se debe de desarrollar una una función que obtenga la raíz cuadrada según el método Babilónico:

El método Babilónico para obtener la raíz cuadrada de un número es el siguiente: primero se divide el número entre si mismo, y se multiplica por si mismo. Si la multiplicación da el número original, se encontró la raiz. Si no, se divide el número original entre el nuevo obtenido anteriormente (a), se suma “a” de nuevo y se divide entre 2. De nueva cuenta se potencia al cuadrado y si se obtiene el número original se termina el ciclo, sino se repite hasta que se obtenga.

Para obtener el método Babilónico me basé en esta fuente:

http://pensamiento-matematico.blogspot.mx/2013/05/metodo-babilonico-de-resolucion-de.html