Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
c7aa86ce
Commit
c7aa86ce
authored
Apr 25, 2017
by
Damien George
Browse files
py/mpz: Strip trailing zeros from mpz value when set from bytes.
parent
5e66f2b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/mpz.c
View file @
c7aa86ce
...
...
@@ -938,6 +938,8 @@ void mpz_set_from_bytes(mpz_t *z, bool big_endian, size_t len, const byte *buf)
#endif
num_bits
-=
DIG_SIZE
;
}
z
->
len
=
mpn_remove_trailing_zeros
(
z
->
dig
,
z
->
dig
+
z
->
len
);
}
bool
mpz_is_zero
(
const
mpz_t
*
z
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment