| | |
(very) simple math not working perhaps due to to large numbers?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2008
Posts: 206
Reputation:
Solved Threads: 31
Generally, you cannot. The contents of limits.h generally reflects technical limits on capability of your compiler on your target operating system. Most compilers will need to be rewritten/extended/modified to support a change of those values.
•
•
Join Date: Aug 2008
Posts: 206
Reputation:
Solved Threads: 31
You can implement a class type that has the attributes you want (or find such a class type that someone else has implemented). Internally, that type might use an array of integers or (as Freaky_Chris suggested) a string to represent larger values. You would need to define mathematical operations and also things like streaming (so you can read or write the data to a file stream).
•
•
Join Date: Dec 2008
Posts: 111
Reputation:
Solved Threads: 3
well file i/o sounds fine, but about defining mathematical operations and.. still the string and class thing? i dont get it :-( i havent worked with structures and classes for a looong while, so i will re-read some documentation on the subject:-) what do you mean with defining mathematical operations?
would splitting up the large numbers and assigning them to an array of ints help anything??
would splitting up the large numbers and assigning them to an array of ints help anything??
Yo god, where do i report a bug?
By defining mathematical operations he means you need to deal with things such as addition, multiplication etc.
You would do this by overloading the different operators such as operator+().
Also the you will want to overload the stream operators as grumpier suggested that would be the << and >> so that the data can be outputted into files and the standard output. Aswell as read into your data type.
Chris
You would do this by overloading the different operators such as operator+().
Also the you will want to overload the stream operators as grumpier suggested that would be the << and >> so that the data can be outputted into files and the standard output. Aswell as read into your data type.
Chris
Knowledge is power -- But experience is everything
•
•
Join Date: Dec 2008
Posts: 111
Reputation:
Solved Threads: 3
I really dont mean to waste anyone's time, so i hope you will bare with me once again.
@Chris, you want me to save the data in files instead of in variables? and then make the calculation by changing the file instead of a variable?
@grumpier, thanks, at least that makes sence to me now ;-)
EDIT: If i use a file instead of a variable i would still have to asign the value to variable when i want to use it, right?
@Chris, you want me to save the data in files instead of in variables? and then make the calculation by changing the file instead of a variable?
@grumpier, thanks, at least that makes sence to me now ;-)
EDIT: If i use a file instead of a variable i would still have to asign the value to variable when i want to use it, right?
Last edited by Bladtman242; Jan 14th, 2009 at 12:27 pm.
Yo god, where do i report a bug?
![]() |
Other Threads in the C++ Forum
- Previous Thread: Moving the mouse cursor
- Next Thread: need some guidance
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets





