예제 #1
0
// reversed returns a new *big.Int with reversed digits.
func reversed(n *big.Int) *big.Int {
	a := n.String()
	b := tools.ReversedString(a)
	c, _ := new(big.Int).SetString(b, 10)
	return c
}
예제 #2
0
// isPalindrome checks whether the given *big.Int is a palindrome.
func isPalindrome(n *big.Int) bool {
	a := n.String()
	b := tools.ReversedString(a)
	return a == b
}