473,508 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding difference

36 New Member
Hi
i just need to find the difference between to numbers .
if i subtract i am getting the minus symbol,i just want the difference of two numbers .

your help will be appreciated

thanking you in advance
Apr 18 '08 #1
1 5678
nithinpes
410 Recognized Expert Contributor
Hi
i just need to find the difference between to numbers .
if i subtract i am getting the minus symbol,i just want the difference of two numbers .

your help will be appreciated

thanking you in advance

All you need to do is to use abs() function to get the absolute value.

For ex:
Expand|Select|Wrap|Line Numbers
  1. $a = 5;
  2. $b = 12;
  3. $c= abs($a-$b);
  4. print "Difference: $c \n";  ## will print Difference: 7
  5.  
  6.  
Apr 18 '08 #2

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

Similar topics

11
3733
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
22
1987
by: Annajiat | last post by:
Hi, a) int grid; Which of the following is faster? 1. memset(grid,0,1010*1010); 2. memset(grid,0,sizeof(grid)); b) Is there any faster alternative to initializing memory? c) What is the...
15
46440
by: cwsullivan | last post by:
Hi gang, I have a grid full of particles in my program, and I want to find an angle between two particles. I'm having trouble because it seems like the answer depends on whether or not the target...
4
2374
by: lakshmananl | last post by:
hi, i am doing a report generation work in which i take the count of two columns. and i need to calculate the difference of the counted value as a new column. for example in SQL we use ...
5
74202
by: prileep | last post by:
Hi, I want to find the the exact difference between two dates in seconds through MySQL query. Version: 4.1 Platform: Linux Source code: >select datediff('2007-01-09 10:24:46','2007-01-09...
1
7843
by: indiarocks | last post by:
This is probably a very basic question, how do I find out the difference between two system time. I tried x1 = t1.clock x2 = t2.clock x2 - x1 doesn't seem to give me the difference. ...
17
3763
by: abhimanyu.v | last post by:
Hi Guys, I have one doubt. The test program is given below. It uses two way of finding out the offset of a variable in structure. I executed the program and found the same result. My question...
3
1795
by: cheguashwini | last post by:
Hi I have a problem. I have two tables...table1 and table2. table1 has the column latitude and sno(serial number) and table2 has the column lat and sno(serial number) . i have to find the...
2
1977
by: Shamim1983 | last post by:
I want to find difference between 2 dates in number of months using GregorianCalendar utility. I want it to work fine considering the year having 28, 29, 30 or 31 days in month. It should give me...
275
12038
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
7225
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
7123
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
7383
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...
1
7046
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
5627
agi2029
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,...
1
5053
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
4707
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
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.