aboutsummaryrefslogtreecommitdiffstats
path: root/common/math/big.go
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2017-06-09 05:16:05 +0800
committerMartin Holst Swende <martin@swende.se>2017-06-09 05:16:05 +0800
commitac9865791a691094293e08702623c3a1374eeb5f (patch)
tree38da9b843983af96214b06b3a4fd33d729b04939 /common/math/big.go
parent1496b3aff6a537a1c5597ec55b8d3b25afded26c (diff)
downloaddexon-ac9865791a691094293e08702623c3a1374eeb5f.tar
dexon-ac9865791a691094293e08702623c3a1374eeb5f.tar.gz
dexon-ac9865791a691094293e08702623c3a1374eeb5f.tar.bz2
dexon-ac9865791a691094293e08702623c3a1374eeb5f.tar.lz
dexon-ac9865791a691094293e08702623c3a1374eeb5f.tar.xz
dexon-ac9865791a691094293e08702623c3a1374eeb5f.tar.zst
dexon-ac9865791a691094293e08702623c3a1374eeb5f.zip
core/vm, common/math: Add doc about Byte, fix format
Diffstat (limited to 'common/math/big.go')
-rw-r--r--common/math/big.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/math/big.go b/common/math/big.go
index c49d751fa..787278650 100644
--- a/common/math/big.go
+++ b/common/math/big.go
@@ -131,7 +131,7 @@ func PaddedBigBytes(bigint *big.Int, n int) []byte {
}
// bigEndianByteAt returns the byte at position n,
-// if bigint is considered big-endian.
+// in Big-Endian encoding
// So n==0 returns the least significant byte
func bigEndianByteAt(bigint *big.Int, n int) byte {
words := bigint.Bits()
@@ -148,9 +148,9 @@ func bigEndianByteAt(bigint *big.Int, n int) byte {
}
// Byte returns the byte at position n,
-// if bigint is considered little-endian with the supplied padlength.
-// n==0 returns the most significant byte
-// bigint '5', padlength 32, n=31 => 5
+// with the supplied padlength in Little-Endian encoding.
+// n==0 returns the MSB
+// Example: bigint '5', padlength 32, n=31 => 5
func Byte(bigint *big.Int, padlength, n int) byte {
if n >= padlength {
return byte(0)