473,464 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ValueError: invalid literal for int(): 1.0000000000e+00

Hi,
is this a bug or "feature" that I have to use float() to make int() autoconvert
from it?

$ python
Python 2.3.4 (#1, Feb 14 2005, 10:00:27)
[GCC 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
a = 1
"%5.10e" % (a) '1.0000000000e+00' int("%5.10e" % (a)) Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): 1.0000000000e+00 int(float("%5.10e" % (a))) 1

Jul 18 '05 #1
1 2302
On 2005-02-14, Martin MOKREJ© <mm******@ribosome.natur.cuni.cz> wrote:
is this a bug or "feature" that I have to use float() to make int() autoconvert
from it?


It's a feature. Integers don't have decimal points...

--
Grant Edwards grante Yow! I just had a NOSE
at JOB!!
visi.com
Jul 18 '05 #2

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

Similar topics

3
by: tag | last post by:
Hi, I have a xml field: <Cell Col="2" Row="10">="Actual Asset mix "&text($C$46,"dd-mmm-yyyy")</Cell> ^ | this is column 56
10
by: jeff regoord | last post by:
A user inputs a float value. The scanf() function gets the value. However, I need to create an error handler with an if else statement saying invalid input if the input is not a number. Does...
0
by: CW | last post by:
I get this FieldCount error when I attempt to bind a datagrid with a dataset, not a datareader object. The code snippet is as belows: 'PopulateForm called in Page Load event Private Sub...
9
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its...
2
by: Phil Lee | last post by:
What's the general opinion on which of these to choose? I see that the SoapDocumentServiceAttribute defaults to literal/wrapped, but this article -...
0
by: shrik | last post by:
I have following error : Total giant files in replay configuration file are : File name : /new_file/prob1.rec Given file /new_file/prob1.rec is successfully verified. Splitting for giant file...
1
by: shiznit | last post by:
I made a program that finds a minimum spanning tree. In my main I created kruskal k; and called k.findMST(); void kruskal :: findMST(){
11
by: davidj411 | last post by:
i am parsing a cell phone bill to get a list of all numbers and the total talktime spend on each number. i already have a unique list of the phone numbers. now i must go through the list of...
2
by: Mario Ruggier | last post by:
On OS X 10.5.2 : $ python Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13) on darwin Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last):...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.