Re: solving an equation multiple directions
- From: William Elliot <marsh@xxxxxxxxxxxxxxxx>
- Date: Fri, 16 Jan 2009 07:34:45 -0800
On Fri, 16 Jan 2009, Jason wrote:
I want to write a function in a computer language like C or Java.Are you sure you want a function?
I want the function to solve for one variable then another without
writing the equation twice.
Example:
x = y + z (given y and z)
y = x - z (given x and z)
but without writing two equations to prevent duplication in my code.
Any ideas?
Perhaps you want a subroutine.
More likely you need clear thinking.
What input are you giving the function or subroutine?
An equation such as z = x + y ?
What output are you expecting?
More equations such as x = y - z and y = x - z ?
What do you mean without writing the code twice?
That's what functions and subroutines are used for,
to not repleat code at the additional time cost of
calling and returning from a function or subroutine.
.
- Follow-Ups:
- Re: solving an equation multiple directions
- From: Jason
- Re: solving an equation multiple directions
- References:
- solving an equation multiple directions
- From: Jason
- solving an equation multiple directions
- Prev by Date: solving an equation multiple directions
- Next by Date: Moncler down jacket
- Previous by thread: solving an equation multiple directions
- Next by thread: Re: solving an equation multiple directions
- Index(es):
Relevant Pages
|