Commit a06896a4 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

fixed bug: datrw::su::ScalCoo::set(const double&) has to use correct

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.
initial scale value


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 4480
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent d6dfc7f1
......@@ -56,11 +56,14 @@
* digits. I see no reason for this cast and remove
* it.
* - reworked ScalCoo::smallestpower(const short&)
* - 26/01/2012 V1.5 bug fix: ScalCoo::set(const double&):
* initial scale value must equal one
* see ticket:168
*
* ============================================================================
*/
#define DATRW_SUCOMANAGER_CC_VERSION \
"DATRW_SUCOMANAGER_CC V1.4"
"DATRW_SUCOMANAGER_CC V1.5"
#define DATRW_SUCOMANAGER_CC_CVSID \
"$Id$"
......@@ -139,12 +142,12 @@ namespace datrw {
void ScalCoo::set(const double& value)
{
const bool debug=false;
this->scale=Mcontrol.scalco;
this->scale=1;
this->coo=static_cast<int>(nearbyint(value));
double v=(value>=0 ? value : -value);
if (v<ScalCoo::effectivezero)
{
this->scale=Mcontrol.scalco;
this->scale=1;
this->coo=0;
}
else
......@@ -210,6 +213,8 @@ namespace datrw {
this->coo=static_cast<int>(nearbyint(value/s));
}
} // if (v<ScalCoo::effectivezero), else clause
// adjust scale
this->scaletopower(this->smallestpower(Mcontrol.scalco));
DATRW_debug(debug, "ScalCoo::set(const double& value)",
"value on exit:"
<< " value: " << value
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment