Example #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
}
Example #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
}