aboutsummaryrefslogtreecommitdiffstats
path: root/big.go
diff options
context:
space:
mode:
authorobscuren <obscuren@obscura.com>2013-12-26 19:45:52 +0800
committerobscuren <obscuren@obscura.com>2013-12-26 19:45:52 +0800
commit5db3335dce766bd679c54ea44f6df08a7ff74762 (patch)
tree75614c847fdc07150351e9aa02353d8f1d23196c /big.go
downloadgo-tangerine-5db3335dce766bd679c54ea44f6df08a7ff74762.tar.gz
go-tangerine-5db3335dce766bd679c54ea44f6df08a7ff74762.tar.zst
go-tangerine-5db3335dce766bd679c54ea44f6df08a7ff74762.zip
Initial commit
Diffstat (limited to 'big.go')
-rw-r--r--big.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/big.go b/big.go
new file mode 100644
index 000000000..71e7573e1
--- /dev/null
+++ b/big.go
@@ -0,0 +1,20 @@
+package main
+
+import (
+ "math/big"
+)
+
+func BigPow(a,b int) *big.Int {
+ c := new(big.Int)
+ c.Exp(big.NewInt(int64(a)), big.NewInt(int64(b)), big.NewInt(0))
+
+ return c
+}
+
+func Big(num string) *big.Int {
+ n := new(big.Int)
+ n.SetString(num, 0)
+
+ return n
+}
+