Thread: Testcase for a mathematical equation

1. Testcase for a mathematical equation

How to write a TSL Script (TestCase) for the simple mathematical equation y=2x2 (y equals to two ex square).

2. Re: Testcase for a mathematical equation

In Perl script language, it's written as
y=2*x**2
Hope that helps

3. Re: Testcase for a mathematical equation

You can use the follwoing user defined function:

public function square(in x)

{
auto y;
y=2(x*x);

printf(y);

}

//now call the above function

square();

Let me know!

4. Re: Testcase for a mathematical equation

Originally posted by rmakam:
Let me know!
<font size="2" face="Verdana, Arial, Helvetica">square(3) returns 29 ("2" & 3*3).
I think that's not the result you want...

WRs square is the caret sign:
x^2, x^3, x^4, ...

So the function square() needs this line of code:
y=2*(x*x); or
y=2*(x^2);

Regards,
Juergen

5. Re: Testcase for a mathematical equation

Not sure if the original poster is looking for:
y=2x<sup>2</sup>
or
y=2<sup>x<sup>2</sup></sup>

If the first case, the WR function would be something like:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">public function two_x_2(in x)
{
return(2*(x^2));
}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">If the latter case, the WR function would be something like:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">public function two_x_2(in x)
{
return(2^(x^2));
}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:10 PM.

Copyright BetaSoft Inc.