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

Subtraction Problem in Javascript

If i subtract .01 from 100000000000000 like 100000000000000 - Math.pow(10,(-1 * 2)), i am getting 99999999999999.98. If i cut one zero from the number, result is correct and if i add one more zero to the number, subtraction won't happen.Can somebody help to solve it?
Oct 20 '06 #1
2 1854
In Javascript if i subtract .01 from 100000000000000 like 100000000000000 - Math.pow(10,(-1 * 2)), i am getting 99999999999999.98. If i cut one zero from the number, result is correct and if i add one more zero to the number, subtraction won't happen.Can somebody help to solve it?
Oct 27 '06 #2
ajk99
1
In Javascript if i subtract .01 from 100000000000000 like 100000000000000 - Math.pow(10,(-1 * 2)), i am getting 99999999999999.98. If i cut one zero from the number, result is correct and if i add one more zero to the number, subtraction won't happen.Can somebody help to solve it?
Did you find an answer? I was surprised to discovered that 250 - 39.92 = 210.07999999999998 in both IE and Firefox.
Rgrds
Apr 24 '07 #3

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

Similar topics

1
by: chelleybabyger | last post by:
How do i handle a subtraction between 2 entries in a table? they each belong to 2 tables. my code is below. I wish to subtract ordereditems_quantity from product_stock but i have no idea how to do it...
4
by: August1 | last post by:
I've written an interface and implementation file along with a client source file that allows the use of an overloaded subtraction operator. However, when using the program, I'm running into a...
2
by: Max | last post by:
I'm reading some files in a directory using php code for the end result of allowing these files to be deleted. The problem is some of the file names have hyphens in them, and this cannot be...
34
by: Andy | last post by:
Hi, Are 1 through 4 defined behaviors in C? unsigned short i; unsigned long li; /* 32-bit wide */ 1. i = 65535 + 3; 2. i = 1 - 3; 3. li = (unsigned long)0xFFFFFFFF + 3; 4. li = 1...
5
by: bruce.james.lee | last post by:
hi i have a problem with integer subtraction in C. printf("%d", c < (a - b)); a is got from a #define and is 0x80000000 and b is got from input and is also 0x80000000. c is ffffffff (-1)....
5
by: Mark Cave-Ayland | last post by:
Hi everyone, I'm trying to calculate an output column which is the difference of two other columns in the query output; the first column is an aggregate of items in stock, while the second...
3
by: muler | last post by:
hi all, After reading this excerpt from "The C# Programming Language", (By Anders) I tried to check it out. Unfortunately, I'm getting compile errors. Can anyone illustrate this with an...
20
by: junky_fellow | last post by:
Hi, In my previous post I asked if sizeof may be implemented as a function. Somebody pointed a link that says that sizeof may calculated as follows with a warning that it is not guaranteed to...
5
by: Keflavich | last post by:
Hey, I have a bit of code that died on a domain error when doing an arcsin, and apparently it's because floating point subtraction is having problems. I know about the impossibility of storing...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.