 
Member
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). 
Junior Member
Re: Testcase for a mathematical equation In Perl script language, it's written as
y=2*x**2
Hope that helps 
Junior Member
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! A good tester is the one who gets most of the bugs fixed 
Senior Member
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 
Senior Member
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="fontsize:xsmall; fontfamily: 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="fontsize:xsmall; fontfamily: monospace;">public function two_x_2(in x)
{
return(2^(x^2));
}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica"> web site  [url=http://www.ebookworm.us/[/url]
[i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules 