Click here to Skip to main content
15,909,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCString cutting off my string Pin
Wheatbread14-Jan-05 4:21
Wheatbread14-Jan-05 4:21 
GeneralRe: CString cutting off my string Pin
Chris Losinger14-Jan-05 8:04
professionalChris Losinger14-Jan-05 8:04 
GeneralWeird <= operation Pin
alex120514-Jan-05 4:08
alex120514-Jan-05 4:08 
GeneralRe: Weird <= operation Pin
basementman14-Jan-05 4:24
basementman14-Jan-05 4:24 
GeneralRe: Weird <= operation Pin
Malcolm Smart14-Jan-05 4:39
Malcolm Smart14-Jan-05 4:39 
GeneralRe: Weird <= operation Pin
Ravi Bhavnani14-Jan-05 6:11
professionalRavi Bhavnani14-Jan-05 6:11 
GeneralRe: Weird <= operation Pin
Malcolm Smart14-Jan-05 13:00
Malcolm Smart14-Jan-05 13:00 
GeneralRe: Weird <= operation Pin
Ravi Bhavnani14-Jan-05 14:52
professionalRavi Bhavnani14-Jan-05 14:52 
Angel1058 wrote:
So all these financial and scientific calculations ... they are approximations?!?

Correct.

Most scientific and financial applications (including my hack TakeStock[^] (forgive the shameless plug - but after all, it is freeware) will instead store floating point numbers as an aggregation of integers (which can be accurately compared).

So a bank balance of $12,345,678.90123 will instead be stored as the integer value 1,234,567,890,123 "milli cents". Since the number of mCents could be extremely large, you need store this value in a collection of ints. In the 70's and early 80's, many programmers used PL/1 which included a DECIMAL data structure for exactly this kind of thing.

Microsoft provides the CURRENCY[^] type that suffices for most financial calculations.

Hope this helps!

/ravi

My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com

GeneralRe: Weird <= operation Pin
Anonymous17-Jan-05 15:26
Anonymous17-Jan-05 15:26 
GeneralRe: Weird <= operation Pin
peterchen16-Jan-05 19:03
peterchen16-Jan-05 19:03 
QuestionHow to export Symbol from Win Static Library Pin
ashutosh_tripathi14-Jan-05 3:18
ashutosh_tripathi14-Jan-05 3:18 
AnswerRe: How to export Symbol from Win Static Library Pin
Martin Koorts14-Jan-05 3:44
Martin Koorts14-Jan-05 3:44 
GeneralRe: How to export Symbol from Win Static Library Pin
ashutosh_tripathi14-Jan-05 17:49
ashutosh_tripathi14-Jan-05 17:49 
GeneralRe: How to export Symbol from Win Static Library Pin
Martin Koorts16-Jan-05 22:53
Martin Koorts16-Jan-05 22:53 
GeneralOnPaint and CPaintDC Pin
Malcolm Smart14-Jan-05 3:02
Malcolm Smart14-Jan-05 3:02 
GeneralRe: OnPaint and CPaintDC Pin
Ryan Binns14-Jan-05 3:40
Ryan Binns14-Jan-05 3:40 
GeneralRe: OnPaint and CPaintDC Pin
Mike Dimmick14-Jan-05 3:40
Mike Dimmick14-Jan-05 3:40 
GeneralRe: OnPaint and CPaintDC Pin
Malcolm Smart14-Jan-05 4:37
Malcolm Smart14-Jan-05 4:37 
GeneralLoading HTML documents Pin
Hans Ruck14-Jan-05 2:00
Hans Ruck14-Jan-05 2:00 
GeneralPls Help with CMetaFileDC and CScrollView Pin
Dimitris Vikeloudas14-Jan-05 0:41
Dimitris Vikeloudas14-Jan-05 0:41 
QuestionVC6 - bug? Could you try on your Box? Pin
peterchen14-Jan-05 0:24
peterchen14-Jan-05 0:24 
AnswerRe: VC6 - bug? Could you try on your Box? Pin
peterchen14-Jan-05 0:29
peterchen14-Jan-05 0:29 
AnswerRe: VC6 - bug? Could you try on your Box? Pin
Aamir Butt14-Jan-05 0:38
Aamir Butt14-Jan-05 0:38 
GeneralRe: VC6 - bug? Could you try on your Box? Pin
peterchen14-Jan-05 1:24
peterchen14-Jan-05 1:24 
GeneralRe: VC6 - bug? Could you try on your Box? Pin
Aamir Butt16-Jan-05 17:31
Aamir Butt16-Jan-05 17:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.