473,471 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

please i need some advice on optimization

hi i am using a function which does a floating point "modulus"
operation.

it takes 2 floats as input and wraps the first float (float1) to fit in
the range 0 .. float2

I was originally using a math function fmod but this was really slow so
i replaced it with an inline function i wrote. this was a lot faster,
but still there is room for improvement.

What is the fastest function which performs this operation ?

If i want to write it in assembly, can someone explain to me the syntax
for embedding assmebler in my visual c++ 6 projects ?

Thanks

- Jason

Nov 4 '05 #1
1 1219

"Jason Lang" <ja***********@yahoo.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
hi i am using a function which does a floating point "modulus"
operation.

it takes 2 floats as input and wraps the first float (float1) to fit in
the range 0 .. float2

I was originally using a math function fmod but this was really slow so
i replaced it with an inline function i wrote. this was a lot faster,
but still there is room for improvement.

What is the fastest function which performs this operation ?
The C++ language makes no requirements about 'speed'. Only
behavior.
If i want to write it in assembly, can someone explain to me the syntax
for embedding assmebler in my visual c++ 6 projects ?


Not here. Ask in a group about Visual C++. You can find one
with google, or by checking at www.msdn.microsoft.com

-Mike
Nov 4 '05 #2

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

Similar topics

12
by: Gaurav | last post by:
Hello I have a program that basically inverts the contents of files except first line. It compiles fine but gives me core dump on running. If i comment temp.clear() it runs fine, but i need...
5
by: Carl Bevil | last post by:
I'm creating a library for internal use that relies on third-party code. I don't want clients of this library to know anything about the third party code, when compiling or running. Generally...
11
by: Petre Huile | last post by:
I have designed a site for a client, but they have hired an internet marketing person to incrase their search engine ranking and traffic. He wants to put extra-large fonts on every page which will...
16
by: gorda | last post by:
Hello, I am playing around with operator overloading and inheritence, specifically overloading the + operator in the base class and its derived class. The structure is simple: the base class...
28
by: Jed | last post by:
Hello to all! I have a couple of projects I intend starting on, and was wondering if someone here could make a suggestion for a good compiler and development environment. My goals are as...
31
by: mark | last post by:
Hello- i am trying to make the function addbitwise more efficient. the code below takes an array of binary numbers (of size 5) and performs bitwise addition. it looks ugly and it is not elegant...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
0
by: qonhfmwfyrqx | last post by:
Discover how to quickly and easily create search engine optimized affiliate web sites that can make you money, even without any HTML knowledge or search engine optimization skills. Create...
22
by: rasiel | last post by:
I'm hoping someone can help me out. I'm a researcher in need of developing an automated database and would like to see if someone here is willing to consider putting together for me a simple...
1
by: sukatoa | last post by:
The code below, //I need help here.... public void processChangedLines(int offset, int length) throws BadLocationException { String text = getText(); ResetColor(); ...
0
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
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
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
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,...
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?
0
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 ...
0
muto222
php
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.