cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
how to improve - HCF
Page 2
how to improve - HCF
Pages:
1
2
May 15, 2012 at 8:46pm UTC
vlad from moscow
(6539)
I did not suggest to use abs because I do not like to call a function (moreover two times) for such simple operations.
As for the replacement whether for example 10 % 6 is the same as 6 % 10?
May 15, 2012 at 9:37pm UTC
ne555
(10692)
6%10 = 6
In the next iteration you will compute 10%6
I do not like to call a function (moreover two times) for such simple operations.
There is no big overload. If that's an issue you could inline the call.
¿What do you think that functions are for?
Last edited on
May 15, 2012 at 9:38pm UTC
May 15, 2012 at 9:42pm UTC
andywestken
(4094)
Also, note that some compilers supply intrinsics for small, common operations.
abs()
is one of the functions which Visual C++ treats in this way.
http://msdn.microsoft.com/en-US/library/5704bbxw%28v=vs.80%29
Compiler Intrinsics
http://msdn.microsoft.com/en-us/library/26td21ds%28v=vs.80%29
Most functions are contained in libraries, but some functions are built in (that is, intrinsic) to the compiler. These are referred to as intrinsic functions or intrinsics.
Last edited on
May 15, 2012 at 9:57pm UTC
Topic archived. No new replies allowed.
Pages:
1
2