Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: redundant allocation [modified] Pin
toxcct5-Mar-08 4:10
toxcct5-Mar-08 4:10 
GeneralRe: redundant allocation Pin
George_George5-Mar-08 18:29
George_George5-Mar-08 18:29 
GeneralRe: redundant allocation Pin
toxcct5-Mar-08 21:16
toxcct5-Mar-08 21:16 
GeneralRe: redundant allocation Pin
George_George5-Mar-08 21:39
George_George5-Mar-08 21:39 
GeneralTruncate a number with decimals Pin
piul5-Mar-08 1:57
piul5-Mar-08 1:57 
GeneralRe: Truncate a number with decimals Pin
Cedric Moonen5-Mar-08 2:02
Cedric Moonen5-Mar-08 2:02 
GeneralRe: Truncate a number with decimals Pin
piul5-Mar-08 2:06
piul5-Mar-08 2:06 
GeneralRe: Truncate a number with decimals Pin
CPallini5-Mar-08 2:13
mveCPallini5-Mar-08 2:13 
piul wrote:
2.0024334 and 2.0024992 should be seen as equal because the first 4 decimals are the same.


Then the best way is

double x = 2.0024334;
double y = 2.0024992;
const double EPS = .0001;
if ( fabs(x-y) < EPS )
{ // the numbers are equal within give precision
  //...
}
else
{ // the numbers are different
  //...
}

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke


GeneralRe: Truncate a number with decimals Pin
CPallini5-Mar-08 2:09
mveCPallini5-Mar-08 2:09 
GeneralRe: Truncate a number with decimals Pin
piul5-Mar-08 2:14
piul5-Mar-08 2:14 
GeneralRe: Truncate a number with decimals Pin
CPallini5-Mar-08 2:17
mveCPallini5-Mar-08 2:17 
GeneralRe: Truncate a number with decimals Pin
Eric Pruneau5-Mar-08 5:33
Eric Pruneau5-Mar-08 5:33 
GeneralProblem with Release Mode Pin
ritz12345-Mar-08 1:49
ritz12345-Mar-08 1:49 
GeneralRe: Problem with Release Mode Pin
Cedric Moonen5-Mar-08 2:00
Cedric Moonen5-Mar-08 2:00 
GeneralRe: Problem with Release Mode Pin
CPallini5-Mar-08 2:00
mveCPallini5-Mar-08 2:00 
GeneralRe: Problem with Release Mode Pin
_AnsHUMAN_ 5-Mar-08 2:01
_AnsHUMAN_ 5-Mar-08 2:01 
QuestionHow to get the username associated with a process using win32 apis Pin
vineeshV5-Mar-08 1:24
vineeshV5-Mar-08 1:24 
AnswerRe: How to get the username associated with a process using win32 apis Pin
Rajkumar R5-Mar-08 3:11
Rajkumar R5-Mar-08 3:11 
QuestionRe: How to get the username associated with a process using win32 apis Pin
vineeshV9-Mar-08 23:45
vineeshV9-Mar-08 23:45 
AnswerRe: How to get the username associated with a process using win32 apis Pin
Rajkumar R10-Mar-08 0:02
Rajkumar R10-Mar-08 0:02 
GeneralRe: How to get the username associated with a process using win32 apis Pin
vineeshV10-Mar-08 1:01
vineeshV10-Mar-08 1:01 
GeneralRe: How to get the username associated with a process using win32 apis Pin
Rajkumar R10-Mar-08 4:24
Rajkumar R10-Mar-08 4:24 
GeneralRe: How to get the username associated with a process using win32 apis Pin
Rajkumar R10-Mar-08 4:45
Rajkumar R10-Mar-08 4:45 
Generalcacls cmd equivalent in win32 Pin
dharani4-Mar-08 23:13
dharani4-Mar-08 23:13 
QuestionRe: cacls cmd equivalent in win32 Pin
Rajkumar R4-Mar-08 23:25
Rajkumar R4-Mar-08 23:25 

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.