How to convert

L

Lad

How can I covert in Python a variable of a long type to variable of
Integer type?
Thank you for reply
L.
 
F

Felipe Almeida Lessa

Em Sáb, 2006-03-18 às 05:12 -0800, Lad escreveu:
How can I covert in Python a variable of a long type to variable of
Integer type?

You can do "int(variable)", but it can't be always done (for example,
when variable > MAX_INT):
1000000000000000000000000000000000000000000000000000000000000000L
 
F

Felipe Almeida Lessa

Em Sáb, 2006-03-18 às 10:38 -0300, Felipe Almeida Lessa escreveu:
Em Sáb, 2006-03-18 às 05:12 -0800, Lad escreveu:

You can do "int(variable)", but it can't be always done (for example,
when variable > MAX_INT):

A more concrete example:-2147483649L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top