473,943 Members | 17,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How a number is divided with out using divide operator ?

1 New Member
hai all,
Can u help me to devied a number by 16 with out using Devied operator.
Sep 4 '07 #1
1 1344
JosAH
11,448 Recognized Expert MVP
hai all,
Can u help me to devied a number by 16 with out using Devied operator.
16 is a power of two; the bit shift operators are very good with those.

kind regards,

Jos
Sep 4 '07 #2

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

Similar topics

9
11588
by: Adam Knight | last post by:
I am dividing a value by two..what i need is to round the number up if it is not a whole number. Any suggestions on how to do this ?? Help appreciated!! AK
16
4242
by: Jason | last post by:
Hi, I need a way to use random numbers in c++. In my c++ project, when using the mingw compiler I used a mersenne twister that is publicly available and this did its job well. Now I have shelled out on VC++ 6.0 compiling that same code is proving difficult. I am not too worried how I generate random numbers in c++, as long as it is sufficiently random. Can anybody help me out in getting what I want from VC++?
25
1760
by: snow.carriers | last post by:
Hello, I would like to know how to do this: Basically when I input a number, such as 123, it should display 6 (1+2+3), and for 666 would be 18. I'm a bit stuck here... I know it would involve a while loop along that can do this condition: nd1=num/100%10; nd2=num/10%10; nd3=num%10;, etc
5
5783
by: Jeff | last post by:
I am trying to crete a method that will convert an improper fraction to a mixed number... I am not sure how about how to acomplish this. I know I can get the remainder with the modulus operator (%), but I am not sure how to get the quotent. any insight would be appreciated. thanks
5
3372
by: Peteroid | last post by:
I know how to use rand() to generate random POSITIVE-INTEGER numbers. But, I'd like to generate a random DOUBLE number in the range of 0.0 to 1.0 with resolution of a double (i.e., every possible double value in the range could come up with equal probability). I'd also like to be able to seed this generator (e.g., via the clock) so that the same sequence of random values don't come up every time. Anybody have an easy and fast...
4
1494
by: Pietro | last post by:
Thanks for the last answer, but now how can i restart the count of the Build and Revision numbers of a dll in VS.Net. Thanks Pietro
8
4156
by: gavinstone007 | last post by:
Who can solve this? Wrte a class number which represents all numbers. Implement member functions to carry out the following arithmetic operations on class instances, add- which returns an object of class number whose value is the sum of the numbers added, subtract- returns an object of class number and value is the result subtracting the second number object from the first, multiply and divide (the return formats are the same as for add...
1
2793
by: Generic Usenet Account | last post by:
I had a need to create my own RandomNumberGenerator class, for use with random_shuffle (I did not want the same sequence generated each time). I looked up an example provided by Nicolai M. Josuttis, in his fantastic book : The C++ Standard Library - A Tutorial and Reference (http://www.josuttis.com/libbook/). Here is what he had: class MyRandom { public: ptrdiff_t operator() (ptrdiff_t max) { double tmp;
3
2525
by: td0g03 | last post by:
Like the titles says I'm suppose to generate a random number then divide that by a number inputed by a user. The random number can range from 2-8. I tried to do the code, but I get some weird result here is the result Please enter a number: 18 a. number 18.00 b. the random number 6 00-1.#J << suppose to be 3 , but I get this number. (Trying to get 18 divided by 6. This is the code I have so...
0
10143
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11539
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11133
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11303
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10666
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7393
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6090
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6312
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.