Skip to content

Value change after uint256.FromBig and then ToBig #115

@Requiemu

Description

@Requiemu

Negative value change after uint256.FromBig and then ToBig:

func TestReverse(t *testing.T) {
	a, _ := big.NewInt(0).SetString("-1", 10)
	u, _ := uint256.FromBig(a)
	areverse := u.ToBig()
	fmt.Println(areverse, areverse.Sign(), a.Sign())
	// areverse:  115792089237316195423570985008687907853269984665640564039457584007913129639935 1 -1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions