From ac9865791a691094293e08702623c3a1374eeb5f Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 8 Jun 2017 23:16:05 +0200 Subject: core/vm, common/math: Add doc about Byte, fix format --- common/math/big.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common/math/big.go') 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) -- cgit v1.2.3