Houge
Member
|
TextReal strange behaviour
I have Dbl = 29.95, when i do
I get 30.9!
works as expected.
It doesn't work if I do "num = 29.95" actually, and that is very strange; It works only when I read this Dbl from database.
Here is the complete working example, you don't need any DB to test it, as i made this Dbl through fileMem()
Code:
/******************************************************************************/
Dbl num = 0;
void InitPre()
{
EE_INIT();
}
/******************************************************************************/
bool Init()
{
File f; f.writeMem();
f.putByte(0x33)
.putByte(0x33)
.putByte(0x33)
.putByte(0x33)
.putByte(0x33)
.putByte(0xF3)
.putByte(0x3D)
.putByte(0x40)
.pos(0);
num = f.getDbl();
D.mode(320, 240);
return true;
}
/******************************************************************************/
void Shut()
{ }
/******************************************************************************/
bool Update()
{ return true; }
/******************************************************************************/
void Draw()
{
D.scale(3);
D.clear(TURQ); // clear screen to turquoise color
D.text (0, 0.1f, S + "num: " + num);
D.text (0, 0.0f, S + "TextReal(num, 1): " + TextReal(num, 1));
D.text (0, -0.1f, S + "TextReal(num, 2): " + TextReal(num, 2));
}
/******************************************************************************/
P.S. if you do "num = num * -1;" it will be -30.9
P.P.S. Both debug and release, both x32 and x64, i have latest Engine.
(This post was last modified: 10-18-2017 12:32 AM by Houge.)
|
|
10-18-2017 12:25 AM |
|
Esenthel
Administrator
|
RE: TextReal strange behaviour
Thank you for reporting this, let me check..
|
|
10-18-2017 12:53 AM |
|
Esenthel
Administrator
|
RE: TextReal strange behaviour
|
|
10-18-2017 01:25 AM |
|