|
by: Vio |
last post by:
I need to test for equality between simple 2 decimal numbers. For example:
if (10 + 15.99) == 25.99:
do some stuff...
The preceding sentence should be TRUE, but to Python it appears FALSE.
Which is wrong.
Perhaps because Python translates "25.99" to "25.98999999999999998" and
not "25.99", which may be the reason for this error (me...
|
by: kartik |
last post by:
Since the Decimal type can represent any given fractional number
exactly, including all IEEE binary floating-point numbers, wouldn't it
be advisable to use Decimals for all floating point numbers (except
possibly for performance)?
Thanks, Kartik.
|
by: k |
last post by:
I have aproblem when multiplying 2 float
638.9 * 382.8 should = 244570.92
results giving 244570.922
both numbers are float variables , tried using double to much the same
effect ..?????
any assistance much appreciated
|
by: Mike P |
last post by:
Why does this cause the error 'cannot implicitly convert type 'double'
to 'float'? Can you not multiply doubles by floats without converting
them all to the same datatype?
fltPCRateStd = fltPCRateStd * 1.175;
Regards,
Mike
|
by: Anton81 |
last post by:
Hi!
When I do simple calculation with float values, they are rarely exactly
equal even if they should be. What is the threshold and how can I change
it?
e.g. "if f1==f2:" will always mean "if abs(f1-f2)<1e-6:"
Anton
|
|
by: atv |
last post by:
at least to me it is. I can't figure out for the life what it is i'm
doing wrong here.
i have a function called assign_coordinate. usually, i pass a malloced pointer
to it, then individual pointers are malloced within that function. No
problem here.
Now i have a situation in this software, where i need to assign new coordinates
to all...
|
by: Arnaud Delobelle |
last post by:
Hi all,
I want to know the precision (number of significant digits) of a float
in a platform-independent manner. I have scoured through the docs but
I can't find anything about it!
At the moment I use this terrible substitute:
FLOAT_PREC = repr(1.0/3).count('3')
|
by: luca bertini |
last post by:
Hi,
i have strings which look like money values (ie 34.45)
is there a way to convert them into float variables?
everytime i try I get this error: "numb = float(my_line) ValueError:
empty string for float()"
"
here's the code
************
|
by: skanemupp |
last post by:
how do i solve power(5,1.3)?
def power(nbr, po):
if po==0:
return 1
if po>0:
return nbr*power(nbr, po-1)
if po<0:
return 1/power(nbr, -1*po)
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
|