Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
README.md
sumdecimal.go
sumdecimal_test.go

README.md

Sum Decimal

You are given a number n. Your task is to return the sum of the first 1000 decimal places of the square root of n. The most difficult part in Go is to get the Sqrt with arbitrary precision.

Example

The square root of 2 equals 1.4142135623..., so the answer is calculated as 4 + 1 + 4 + 2 + 1 + ..., 1000 digits altogether equals 4482.

SumDecimal(2) = 4482

Run tests with benchmarks

go test -bench .