|
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
|
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++?
|
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
|
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
|
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...
|
|
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
|
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...
|
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;
|
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...
|
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...
|
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...
|
|
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...
|
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,...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
|
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...
|