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

Problem on the range of a data type

Dear All,

Is there any way to get the largest or smallest number of a intrinsic
date type in the c++ code?

Thanks,

Shuisheng

Sep 29 '06 #1
3 1409
shuisheng wrote:
Is there any way to get the largest or smallest number of a intrinsic
date type in the c++ code?
Yes, read about 'std::numeric_limits' template.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Sep 29 '06 #2
"shuisheng" <sh*********@yahoo.comwrote:
Is there any way to get the largest or smallest number of a intrinsic
date type in the c++ code?
Yes...

#include <limits>

using std::numeric_limits;
using std::cout;

int main() {
cout << numeric_limits<int>::min() << '\n';
cout << numeric_limits<int>::max() << '\n';

cout << numeric_limits<double>::min() << '\n';
cout << numeric_limits<double>::max() << '\n';
}

--
There are two things that simply cannot be doubted, logic and perception.
Doubt those, and you no longer*have anyone to discuss your doubts with,
nor any ability to discuss them.
Sep 29 '06 #3
On 29 Sep 2006 10:53:42 -0700 in comp.lang.c++, "shuisheng"
<sh*********@yahoo.comwrote,
>Is there any way to get the largest or smallest number of a intrinsic
date type in the c++ code?
See #include <limits>

Sep 29 '06 #4

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

Similar topics

3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
38
by: jrlen balane | last post by:
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser =...
2
by: Betrock | last post by:
This is probably very simple, but I just can't see my way thru it..... Short version: keyed values(numeric)in a lookup table are stored in a main table. They are displayed as text values - the...
6
by: LordHog | last post by:
Hello all, My lead wants to implement a data range monitor for a project that we are coding. Basically it performs a boundry checking that will take three parameters. I am/was trying to...
5
by: comshiva | last post by:
Hi all, I have converted my existing ASP.NET project from 1.1 to 2.0 and i have found that everything works fine except the linkbutton control in my datagrid which throws an javascript error when...
12
by: Joel Byrd | last post by:
I'm having a little problem with using type-ahead functionality for an auto-suggest box. Sometimes, when I start to type something and the type-ahead shows up, the AJAX will send a request query...
3
by: Ray | last post by:
Hi, I'm working on something with mysql and excel. I'm using python and win32com. All major function works, But I have two problems: 1. the output need to do "auto fit" to make it readable. ...
9
by: QCLee | last post by:
Sir can you help me to transfer my Access Query to MS excel? i have a command button on the form to export the parameter query named "HVACWindwardQuery" to excel spreadsheet and i got the codes...
1
Manikgisl
by: Manikgisl | last post by:
But the problem is we have dates in Varchar instead Datetime While Converting Varchar To Datetime All four formats are unable to Convert ie select Convert(Datetime,'18-11-2008 2:35:19...
4
pradeepjain
by: pradeepjain | last post by:
i had posted the same code in javascript area !! this i am posting bcos of different problem. as you can see in ma code there is a dropdown called sort ...its sorts the result by the value he...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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.