1.8.0 Thyme expression error
8 posts • Page 1 of 1
1.8.0 Thyme expression error
1.8.0
Algodoo failed to calculate unnecessary code
> [0,1](0) == 0 ? 1 : (1/0)
-- Warning: Failed to evaluate: [0, 1](0) == 0 ? 1 : (1 / 0), Division by zero
> [0,1](0) == 0 ? 1 : (0)
1
Algodoo failed to calculate unnecessary code
> [0,1](0) == 0 ? 1 : (1/0)
-- Warning: Failed to evaluate: [0, 1](0) == 0 ? 1 : (1 / 0), Division by zero
> [0,1](0) == 0 ? 1 : (0)
1
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: 1.8.0 Thyme expression error
Kilinich wrote:1.8.0
Algodoo failed to calculate unnecessary code
> [0,1](0) == 0 ? 1 : (1/0)
-- Warning: Failed to evaluate: [0, 1](0) == 0 ? 1 : (1 / 0), Division by zero
> [0,1](0) == 0 ? 1 : (0)
1
The code need a set of {}. (I sometimes forget these {}.
Good code:
condition ? {true case} : {false case}
Fail code:
condition ? true case : false case
Next code doesn't fail to calculate.
- Code: Select all
[0,1](0) == 0 ? {1} : {(1/0)}
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
-

tatt61880 - [Most Helpful Person 2010]
- Posts: 1150
- Joined: Mon Aug 31, 2009 5:45 pm
- Location: Tokyo, Japan
Re: 1.8.0 Thyme expression error
I know that workaround, but it must work without {} too imho.
> 0 == 0 ? 4/2 : 1/1
2
> 0 == 0 ? 4/2 : 1/0
-- Warning: Caught exception: Division by zero, Source\script\Expressions.cpp:190: class SharedPtr<class script::Object> script::CodeBlock::Evaluate(class SharedPtr<class script::Reflected>,const class script::Settings &)
-- Warning: Failed to evaluate: 0 == 0 ? 4 / 2 : 1 / 0, Division by zero
> 0 == 0 ? 4/2 : 1/1
2
> 0 == 0 ? 4/2 : 1/0
-- Warning: Caught exception: Division by zero, Source\script\Expressions.cpp:190: class SharedPtr<class script::Object> script::CodeBlock::Evaluate(class SharedPtr<class script::Reflected>,const class script::Settings &)
-- Warning: Failed to evaluate: 0 == 0 ? 4 / 2 : 1 / 0, Division by zero
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: 1.8.0 Thyme expression error
I noticed that bug too..... (It almost ALWAYS executes false if no {} are used.)
- ags131
- Posts: 71
- Joined: Thu Oct 29, 2009 4:14 pm
Re: 1.8.0 Thyme expression error
I always use braces around all parts of the IF statement. Partly because it might make things a bit more reliable, partly because it is simply easier to comprehend.
But yeah, this was a pretty useless bump.
But yeah, this was a pretty useless bump.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: 1.8.0 Thyme expression error
use {}. This is just how Thyme work.
Emil Ernerfeldt, lead developer
- emilk
- Posts: 616
- Joined: Mon Aug 31, 2009 11:01 am
- Location: Umeå, Sweden
8 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests




