FAQ
For floor you have to use Float.Int()
(https://golang.org/pkg/math/big/#Float.Int)

I have Sqrt, Log and Pow implementations here:
https://godoc.org/github.com/ALTree/floatutils

DISCLAIMER: I don't guarantee correctness of the last decimal digit

It's not a real library, more like a few experiments (I'd like to see at
least Sqrt merged in
math/big, but not right now, it's not tested enough).

Il giorno martedì 1 marzo 2016 21:39:12 UTC+1, Owen Waller ha scritto:
Hi,

I find myself trying to covert some Python code to Go which uses arbitrary
large numbers.
The original Python code takes the square root and floors the result of
one of these numbers.

But, looking at Go's math/big package, I can't work out how square root
one of these numbers. There doesn't, at first glance, seem to be an
arbitrary "pow" function. Likewise the floor function.

As this isn't my usual area, I feel don't understanding something
fundamental. Does anyone have any pointers, or packages, or example code
that can point me in the right direction?

Thanks

Owen
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 9 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 1, '16 at 8:38p
activeMar 3, '16 at 12:05a
posts9
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase