<commit_before>//Author: <NAME>
//date 30/09/2017

//adapted from https://gist.github.com/abesto/3476594

package main

import (
	"fmt"
)

func main() {
  var yourNumber float64
  fmt.Println("Enter your number:")
  fmt.Scanf("%f\n", &yourNumber)
	fmt.Println(Sqrt(yourNumber))

}

// Newton's method
func zNext(z, x float64) float64 {
	return z - (z*z-x)/(2*z)
}<commit_msg>method for calculating square root<commit_after>//Author: <NAME>
//date 30/09/2017

//adapted from https://gist.github.com/abesto/3476594

package main

import (
	"fmt"
)

func main() {
  var yourNumber float64
  fmt.Println("Enter your number:")
  fmt.Scanf("%f\n", &yourNumber)
	fmt.Println(Sqrt(yourNumber))

}

// Newton's method
func zNext(z, x float64) float64 {
	return z - (z*z-x)/(2*z)
}

func Sqrt(x float64) float64 {
	z := zNext(2, x)
	for zn, delta := z, z; delta > 0.00001; z = zn {
		zn = zNext(z, x)
		delta = z - zn
	}
	return z
}
{'fraction_non_alphanumeric': 0.17136659436008678, 'fraction_numerical': 0.0596529284164859, 'mean_word_length': 3.502439024390244, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3255745', 'n_tokens_mistral': 426, 'n_tokens_neox': 380, 'n_words': 92}