root square / two solutions - one variable
Hello,
I have two questions :) : 1) I put the square in a variable x when it gets solved it echos the result x=-1+1 for example How can I make it show them in two different variables ? 2) I make it solve a simple equation with random numbers. Most of times the result is decimal but it shows it as an integer. How to make that variable to hold decimals too ? I guess It's very simple but I couldn't find it in some manuals I have. Thanks alot for your help! Have a nice day, |
can you post your code or make it clearer what your trying to do
|
Re: root square / two solutions - one variable
Quote:
|
2)It's bash scripting.... I can use double ?
1) I mean a sqrt(4) gives two results. -2+2 . The result get's in one variable. I want each in a variable not both in one Thanks |
Could somebody help please ?
|
Try this (where $SQRT is the complete variable)
one=`echo $SQRT | cut -d"+" -f 1` two=`echo $SQRT | cut -d"+" -f 2` |
All times are GMT -5. The time now is 06:03 AM. |