473,397 Members | 2,099 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,397 software developers and data experts.

performance differences between \ and /

I thought I read somewhere that the division symbols \ and / mean different
things in terms of what they do an performance. what exactly is the
difference? thanks!
May 16 '07 #1
4 1242
Smokey Grindle wrote:
I thought I read somewhere that the division symbols \ and / mean
different things in terms of what they do an performance. what
exactly is the difference? thanks!
/ is for normal division, and returns a Double value which includes all
fractional parts of the result of the division.

\ is for integer division, and returns an Integer value which discards all
fractional parts of the result of the division (the return value is always
rounded towards zero).

I'm not aware of any noticeable performance difference between the two; \
may be very slightly faster as there is less floating point work to be done,
but in practical terms I doubt you'd ever notice a difference in general
use.

HTH,

--

(O)enone
May 16 '07 #2
Never knew that. Is this a dotnet feature, or was it always in visual basic?

"(O)enone" <oe****@nowhere.comwrote in message
news:Qg******************@newsfe5-win.ntli.net...
Smokey Grindle wrote:
>I thought I read somewhere that the division symbols \ and / mean
different things in terms of what they do an performance. what
exactly is the difference? thanks!

/ is for normal division, and returns a Double value which includes all
fractional parts of the result of the division.

\ is for integer division, and returns an Integer value which discards all
fractional parts of the result of the division (the return value is always
rounded towards zero).

I'm not aware of any noticeable performance difference between the two; \
may be very slightly faster as there is less floating point work to be
done, but in practical terms I doubt you'd ever notice a difference in
general use.

HTH,

--

(O)enone

May 17 '07 #3
Vayse wrote:
Never knew that. Is this a dotnet feature, or was it always in visual
basic?
It was certainly there in VB6.

--

(O)enone

May 17 '07 #4
Thanks. You live and learn!

"(O)enone" <oe****@nowhere.comwrote in message
news:OZ**************@TK2MSFTNGP03.phx.gbl...
Vayse wrote:
>Never knew that. Is this a dotnet feature, or was it always in visual
basic?

It was certainly there in VB6.

--

(O)enone

May 17 '07 #5

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

Similar topics

37
by: Kevin C | last post by:
Quick Question: StringBuilder is obviously more efficient dealing with string concatenations than the old '+=' method... however, in dealing with relatively large string concatenations (ie,...
133
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
35
by: sacha.prins | last post by:
Hi, I read a lot about DB2 INSERT performance here. I have a nice story as well. The thing is, I work on 2 installations of DB2 (on completely different locations) which run on different (but...
25
by: Daniel P. | last post by:
MS or anyone still claims that C# and VB.NET generate the exact same IL code? http://www.osnews.com/story.php?news_id=5602&page=3
4
by: Ram Stern | last post by:
Hey, I have a ServicedComponent derived class, with only one method that uses ESRI objects. When I run the object in ApplicationActivation set to library I get greate calltimes, but when I set it...
29
by: Olaf Baeyens | last post by:
Because of historical reasons, I have both C# and C++ managed/unmanaged code mixed together in my class library. But I prefer to port code to C# since it compiles faster and the syntax is much...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
3
by: EasyKev | last post by:
We have been trying to upgrade all our C++ projects from VC6 to VS .Net2003 for a while (before VS 2005 arrived), and seem to be stuck now because of the performance degradation seen for the same...
23
by: Nishant Saini | last post by:
Dear All, We have a database which contains many tables which have millions of records. When We attach the database with MS SQL Server 2005 Standard Edition Server and run some queries (having...
5
by: nafej | last post by:
I was running some performance tests for the web application I work on, both on my desktop and laptop. I found that javascript processes MUCH slower on my desktop, even though it's a more powerful...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
0
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...

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.