473,432 Members | 1,692 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,432 software developers and data experts.

As linguagens de programação não conseguem fazer esse simples calculo! Por quê?

3
Expand|Select|Wrap|Line Numbers
  1. print(128.23 - (118.23 + 10)
  2. echo 128.23 - (118.23 + 10);
  3. console.log(128.23 - (118.23 + 10.00))
  4.  
Para este teste, usei PHP, Python e JavaScript e todas me retornaram o mesmo valor
Ao invés de me retornarem um 0 ou até 0.00, me retornaram -2.842170943040401e-14

Alguém consegue me explicar o porquê disto acontecer?
Feb 6 '23 #1
0 608

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: somaBoy MX | last post by:
This may be a stupid question, but what is the easiest way to sort a mysql resultset? For example I have a resulset containing a colomn 'product_name_english' and 'product_name_french' and want...
0
by: Samir Patel | last post by:
Python comes with huge number of build in libraries. Best way to start python is to understand this libraries and what it provides by running simple examples for each libraries. Does anybody know...
0
by: jfranco | last post by:
GANHE DINHEIRO COM A INTERNET E AJUDA MÚTUA! Pode parecer mais uma daquelas falsas notícias que você vê por aí, MAS POR FAVOR LEIA este texto para entender, é muito fácil, simples e funciona!! O...
0
by: Ranger | last post by:
TRANSFORME R$12,00 EM R$12.000,00 SÓ VAI TOMAR UM POUCO DO SEU TEMPO E VC Ñ VAI SE ARREPENDER ACREDITE!!! LEIA COM ATENÇÃO. MÉTODO APROVADO PELA REVISTA EXAME Você já imaginou ganhar até R$...
0
by: Ranger | last post by:
TRANSFORME R$12,00 EM R$12.000,00 SÓ VAI TOMAR UM POUCO DO SEU TEMPO E VC Ñ VAI SE ARREPENDER, ACREDITE!!! MÉTODO APROVADO PELA REVISTA EXAME Você já imaginou ganhar até R$ 12.000,00 ou mais,...
0
by: SHAOLIN | last post by:
MUDE SUA VIDA PARE DE JOGAR NA MEGA SENA! Opções Modo de exibição padrão Exibir como árvore Texto proporcional Texto fixo
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
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: 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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.