isValidDoubleValue(double *)
-
yes, but it does not guarantee will not crash next doublevalue = *ptr;
-
is there any (system) function can test memory pointer to know combination of bits there is real (double, float) value? something like this if(isValidDoubleValue(dptr)) dvalue = 0.0; else dvalue = *dptr; //always no exception crash here what will not crash (all i found (like _isnan) expect given bit combination represents valid state and crashes getting invalid one) thanks
Tibor Blazko wrote: is there any (system) function can test memory pointer to know combination of bits there is real (double, float) value? None that I know of. What's stored at a particular memory location is only important to the application that put it there. In other words, if application A wrote 123.45 to some memory location, it's possible (not to be confused with easy or commonplace) for application B to read that memory location, but application B would not know that those particular bytes represented a
double
orfloat
.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
-
If you have read access, it wont crash will it? Papa while (TRUE) Papa.WillLove ( Bebe ) ;
sometimes will _FPE_INVALID
-
Tibor Blazko wrote: is there any (system) function can test memory pointer to know combination of bits there is real (double, float) value? None that I know of. What's stored at a particular memory location is only important to the application that put it there. In other words, if application A wrote 123.45 to some memory location, it's possible (not to be confused with easy or commonplace) for application B to read that memory location, but application B would not know that those particular bytes represented a
double
orfloat
.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
i know it should represent double just have data with some uninitialized values (sometimes not valid doubles) and this (crashing ones) i want set to 0.0 in correction step nr.1
-
sometimes will _FPE_INVALID
-
sometimes will _FPE_INVALID
Never heard of that, but a look at MSDN with _FPE_INVALID lead me to SIGFPE and that lead me to signal(), a function you can use to set your own signal handler. I never tried that but maybe this is worth a try? Jens
-
After gaining read access, check for Floating point exceptions Papa while (TRUE) Papa.WillLove ( Bebe ) ;
it seems it will end with own fn of this kind just afraid with big data will be exception handling
-
Never heard of that, but a look at MSDN with _FPE_INVALID lead me to SIGFPE and that lead me to signal(), a function you can use to set your own signal handler. I never tried that but maybe this is worth a try? Jens
it seems it will end with own fn of this kind just afraid with big data will be exception handling slow
-
is there any (system) function can test memory pointer to know combination of bits there is real (double, float) value? something like this if(isValidDoubleValue(dptr)) dvalue = 0.0; else dvalue = *dptr; //always no exception crash here what will not crash (all i found (like _isnan) expect given bit combination represents valid state and crashes getting invalid one) thanks
I'm might be missing something here, but if it just uninitialised variables, the following might help you out.
try
{
dValue = *dPtr;
}
catch( . . . )
{
dValue = 0.0;
}Chris Meech We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
-
is there any (system) function can test memory pointer to know combination of bits there is real (double, float) value? something like this if(isValidDoubleValue(dptr)) dvalue = 0.0; else dvalue = *dptr; //always no exception crash here what will not crash (all i found (like _isnan) expect given bit combination represents valid state and crashes getting invalid one) thanks
-
I'm might be missing something here, but if it just uninitialised variables, the following might help you out.
try
{
dValue = *dPtr;
}
catch( . . . )
{
dValue = 0.0;
}Chris Meech We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
yes, it seems it will end this way just comment if someone will read this: call _clearfp (or similar) before = 0.0 t!