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
3270fb4b
Commit
3270fb4b
authored
Jan 15, 2014
by
xyb
Browse files
int() test passed
parent
82e61bdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
py/strtonum.c
View file @
3270fb4b
...
@@ -49,16 +49,14 @@ long strtonum(const char *restrict s, int base) {
...
@@ -49,16 +49,14 @@ long strtonum(const char *restrict s, int base) {
p
-=
2
;
p
-=
2
;
}
}
}
else
if
(
base
==
8
&&
c
==
'0'
)
{
}
else
if
(
base
==
8
&&
c
==
'0'
)
{
if
((
c
|
32
)
==
'o'
)
{
c
=
*
(
p
++
);
base
=
8
;
if
((
c
|
32
)
!=
'o'
)
{
}
else
{
p
-=
2
;
goto
value_error
;
}
}
}
else
if
(
base
==
2
&&
c
==
'0'
)
{
}
else
if
(
base
==
2
&&
c
==
'0'
)
{
if
((
c
|
32
)
==
'b'
)
{
c
=
*
(
p
++
);
base
=
2
;
if
((
c
|
32
)
!=
'b'
)
{
}
else
{
p
-=
2
;
goto
value_error
;
}
}
}
else
{
}
else
{
if
(
base
==
0
)
base
=
10
;
if
(
base
==
0
)
base
=
10
;
...
...
tests/basics/tests/int1.py
View file @
3270fb4b
...
@@ -38,7 +38,7 @@ def test(value, base):
...
@@ -38,7 +38,7 @@ def test(value, base):
test
(
' 1x'
,
0
)
test
(
' 1x'
,
0
)
test
(
' 1
\02
'
,
0
)
test
(
' 1
'
+
chr
(
2
)
+
'
'
,
0
)
test
(
''
,
0
)
test
(
''
,
0
)
test
(
' '
,
0
)
test
(
' '
,
0
)
test
(
'
\t\t
'
,
0
)
test
(
'
\t\t
'
,
0
)
...
...
Write
Preview
Supports
Markdown
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