473,385 Members | 1,445 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,385 software developers and data experts.

Div() function

Is Div() a standard C++ function with iostream or cmath? It seems to be
an incredibly useful function, and works well in Visual C++.

But I don't want to use to non-standard syntax for my project.

Thanks.
Aug 29 '06 #1
5 6194
Schizoid Man wrote:
Is Div() a standard C++ function with iostream or cmath? It seems to be
an incredibly useful function, and works well in Visual C++.

But I don't want to use to non-standard syntax for my project.
I also meant to add that numerous Google searches haven't turned up
anything.

According to Cplusplus.com, div() is not a member of either <iostream>
or <cmath>. Yet, these are the only headers I am importing into the
class that uses this method.

MSDN has some literature, but I couldn't any references to it anywhere else.

Thanks.
Aug 29 '06 #2
Schizoid Man wrote:
Is Div() a standard C++ function with iostream or cmath?
No.

It seems to be an incredibly useful function, and works well in Visual
C++.
The headers <iostreamor <cmathare allowed to import other headers: the
div() function is part of <cstdlib>.
Best

Kai-Uwe Bux

Aug 29 '06 #3
Schizoid Man wrote:
Schizoid Man wrote:
Is Div() a standard C++ function with iostream or cmath? It seems to be
an incredibly useful function, and works well in Visual C++.

But I don't want to use to non-standard syntax for my project.

I also meant to add that numerous Google searches haven't turned up
anything.

According to Cplusplus.com, div() is not a member of either <iostream>
or <cmath>. Yet, these are the only headers I am importing into the
class that uses this method.

MSDN has some literature, but I couldn't any references to it anywhere else.
It's in <cstdlib>

Here some (appropriate) text from the standard.....

26.5 C Library [lib.c.math]

Table 81-Header <cstdlibsynopsis
Functions:
abs labs srand
div ldiv rand

The added signatures are:
ldiv_t div(long, long); // ldiv()

colander

Aug 29 '06 #4
Kai-Uwe Bux wrote:
Schizoid Man wrote:
>Is Div() a standard C++ function with iostream or cmath?

No.

>It seems to be an incredibly useful function, and works well in Visual
C++.

The headers <iostreamor <cmathare allowed to import other headers: the
div() function is part of <cstdlib>.
Hi Kai,

Does <iostreamautomatically import <cstdlib>? Because all I have is
<iostreamand <cmath>.
Aug 30 '06 #5
On Tue, 29 Aug 2006 18:17:54 -0700, Schizoid Man <sc***@sf.comwrote
in comp.lang.c++:
Kai-Uwe Bux wrote:
Schizoid Man wrote:
Is Div() a standard C++ function with iostream or cmath?
No.

It seems to be an incredibly useful function, and works well in Visual
C++.
The headers <iostreamor <cmathare allowed to import other headers: the
div() function is part of <cstdlib>.

Hi Kai,

Does <iostreamautomatically import <cstdlib>? Because all I have is
<iostreamand <cmath>.
One of the changes from C to C++ is in the inclusion of standard
headers.

The C standard specifically prohibits any standard C header from
including any other standard C header.

The C++ standard specifically allows any standard C++ header,
including those inherited from C, to include any other standard C++
header.

So apparently on your particular implementation either <iostreamor
<cmath>, or both, include <cstdlib>. But your next compiler, or even
the next version of your current compiler, might not do so. For the
sake of portability don't count on it, and always implicitly include
every standard header whose types, objects, macros, or functions you
use.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Aug 30 '06 #6

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

Similar topics

1
by: IC | last post by:
Hi - I have a question about the following code: <script> document.write('<span id="outter" style="position:relative;">'); document.write("<object...
4
by: Tony Vasquez | last post by:
Can somoene give me an example of how to center a div, according to it's image size... I am using different images, and so I have to resize it in a functino according to the image's size. So I use...
6
by: mike | last post by:
I have a page that uses a some javascript and it works fine in IE but fails to work in Firefox. Basically what I'm trying to do is have 3 iframes on a page but only displaying one of them at a...
2
by: tpaulson | last post by:
I have a couple of DIV's that I hide/display based on radio buttons. On the DIV's, I have multiple drop down boxes. The source shows that they are populated, but I can't make them drop down. Only...
6
by: Gordowey | last post by:
Where can I find this DIV effect. go to: http://www.amazon.com Put mouse over the text "See All 32 Product Categories" (Top-Middle)..it will open a window with a cool effect... does anyone...
1
by: Grimm | last post by:
I am developing an internalk inteface that integrates alot of seperate tools into one interface. The current version uses one Iframe inside a div layer for positioning. Currently the seperate web...
6
by: Jeremy | last post by:
I've got a floating div which becomes visible when a link is clicked. I want the div to be hidden when the user clicks anywhere on the page except for whithin the div. What is the best way to do...
2
by: samz | last post by:
Hello, 1. How to get my DIV (DIV.Box) fit its content (an image)? width:auto doesn't work? 2. How to get links (A) in this DIV click-able (on the IMG) in IE6 too? Thanks URL:...
4
by: HoangTuanSu | last post by:
I have just got a javascript code from my friend. I've modified it for my purpose but a problem happens. First, here's my code html <body> <table align="center" width="60%" height="100%"...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.