473,385 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

A python problem about int to long promotion just see the idle session

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license()" for more information.

************************************************** **************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
************************************************** **************

IDLE 1.1.2
import sys
save_maxint = sys.maxint
save_maxint 2147483647 save_maxint += 1
save_maxint 2147483648L save_maxint - 1 2147483647L save_maxint + 1 2147483649L save_maxint - 1 2147483647L save_maxint + 1 2147483649L save_maxint - 1 2147483647L save_maxint + 1

2147483649L
from the above you can see what int to long promotion is causing
i dont need to say much please see for yourself. is this a bug or
a feature.

please mail me if you can help

og*******@yahoo.com

May 3 '06 #1
4 1670
"gen_tricomi" <og*******@yahoo.com> wrote:
IDLE 1.1.2
import sys
save_maxint = sys.maxint
save_maxint 2147483647 save_maxint += 1
save_maxint 2147483648L save_maxint - 1 2147483647L save_maxint + 1 2147483649L save_maxint - 1 2147483647L save_maxint + 1 2147483649L save_maxint - 1 2147483647L save_maxint + 1

2147483649L
from the above you can see what int to long promotion is causing
i dont need to say much please see for yourself.


?

</F>

May 3 '06 #2
gen_tricomi wrote:
from the above you can see what int to long promotion is causing
i dont need to say much please see for yourself. is this a bug or
a feature.


This is expected behavior. Why is it problematic for you?

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

May 3 '06 #3

gen_tricomi wrote:
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license()" for more information.

************************************************** **************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
************************************************** **************

IDLE 1.1.2
import sys
save_maxint = sys.maxint
save_maxint 2147483647 save_maxint += 1
save_maxint 2147483648L save_maxint - 1 2147483647L save_maxint + 1 2147483649L save_maxint - 1 2147483647L save_maxint + 1 2147483649L save_maxint - 1 2147483647L save_maxint + 1
2147483649L
from the above you can see what int to long promotion is causing


Nope, it's not the promotion causing the problem.
i dont need to say much please see for yourself. is this a bug or
a feature.
Neither. Try changing the "+" and "-" to "+=" and "-=".

please mail me if you can help
"I don't think there can be any question about it.
It can only be attributable to human error.
This sort of thing has cropped up before...
....and it has always been due...
....to human error."
- HAL, 2001: A Space Odessy


og*******@yahoo.com


May 3 '06 #4
wow i think i was just been too paranoid.
i thought it would affect some precision arithmetic in science.
thanks for the reply

May 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Will Seay | last post by:
At the end of this message I've pasted a script we're trying to modify slightly. I don't believe it is VBscript or javascript but these are the closest groups I could find with my limited...
6
by: Aubrey Hutchison | last post by:
Using Python 2,3,2 with idle for developing programs about 200 lines long. - Problem is not common to any specific program. Program are rather simple with no trick programming. Usually no classes...
145
by: David MacQuigg | last post by:
Playing with Prothon today, I am fascinated by the idea of eliminating classes in Python. I'm trying to figure out what fundamental benefit there is to having classes. Is all this complexity...
15
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 385 open (+21) / 3790 closed (+21) / 4175 total (+42) Bugs : 1029 open (+43) / 6744 closed (+43) / 7773 total (+86) RFE : 262 open...
0
by: Jeff Rush | last post by:
With the recent establishment of the wiki page on python.org for those who offer training services for the Python language, we now have 23 listed, worldwide. ...
12
by: WaterWalk | last post by:
Hello. I wonder what's the effective way of figuring out how a piece of python code works. With C I often find it very useful to be able to run the code in step mode and set breakpoints in a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.