03-03-2009
These methods are having some problems
These methods are very good, but when you are going for float addition i.e. 1.3+3.4 then it won't work.
10 More Discussions You Might Find Interesting
1. Programming
Alright, umm i cant get this to work.
im looking at some example and a book i have.
when i try to compile my program i get an error message.
ld: 0711-317 ERROR: Undefined symbol: .sqrt
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. I did #include<math.h> after my... (2 Replies)
Discussion started by: primal
2 Replies
2. Shell Programming and Scripting
Hi,
I wrote this script
awk -F"\t" '{if ((($1 == 586) || ($1 == 68030)) && (($2/1024) < 512)) print $0"\t"(512-($2/1024))"\t"(512-($2/1024))/256}' pcs.txt
But I want from the calculation in red to get rid of the decimal part. Like instead of 1.75 to keep only 1.Please somebody tell me what... (4 Replies)
Discussion started by: sickboy
4 Replies
3. Programming
Hi, I got an easy problem for you but really difficult for me 'cause I am pretty new to this field
I got header file <math.h> included in my .c file , then I write the code as below:
k = sqrt(i); /* both variables k and i are int */
then I cc temp.c
it says like this
undefined... (4 Replies)
Discussion started by: blf0
4 Replies
4. Programming
I want to calculate secant method using C language
That is a program---->
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
main()
{
double fx(double x);
double x0,x1,x2,f0,f1,f2,err;
int n,i;
printf("\n\n f(x) =x*x*x-5*x-7");
printf("\n\nEnter an interval in"
... (4 Replies)
Discussion started by: cdfd123
4 Replies
5. Shell Programming and Scripting
$ x=1
$ y=1.5
$ z=$((x*y))
bash: 1.5: syntax error: invalid arithmetic operator (error token is ".5")
What's wrong? (2 Replies)
Discussion started by: rockbike
2 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The problem? I hope I fill this out correctly. I have a program that runs like a cash register. It works and... (6 Replies)
Discussion started by: Iceman69
6 Replies
7. Shell Programming and Scripting
I am trying to do some math, so that I can compare the average of six numbers to a variable.
Here is what it looks like (note that when I divide really big numbers, it isn't a real number):
$ tail -n 6 named.stats | awk -F\, '{print$1}'
1141804
1140566
1139429
1134210
1084682
895045... (3 Replies)
Discussion started by: brianjb
3 Replies
8. Shell Programming and Scripting
Hi all,
I am new to PERL scripts, and i have made my first script which i am posting here.
This math tool performs all basic arithmatic functions.
#!/usr/bin/perl
print "\t----------Welcome to Maths Tool-----------\n";
do
{
print "Enter your choice :";
print... (2 Replies)
Discussion started by: PranavEcstasy
2 Replies
9. UNIX for Dummies Questions & Answers
I am struggling with scripting this challenge a friend and I have.
You have file1 and its contents is a single number
you have file 2 and its contents are a different number
you want to add file1 to file2 and have the output be put into file3 (3 Replies)
Discussion started by: minkyboodle
3 Replies
10. UNIX for Dummies Questions & Answers
i have file (my_file.txt) that looks like this:
000000000000010000
000000000000010000
000000000000005000
000000000000005000
000000000000005000
000000000000005000
000000000000005000
000000000000005000
000000000000005000
000000000000005000
all said and one, it should look... (11 Replies)
Discussion started by: lawsongeek
11 Replies
LEARN ABOUT DEBIAN
symdiff
symdiff(3tcl) Symbolic differentiation for Tcl symdiff(3tcl)
__________________________________________________________________________________________________________________________________________________
NAME
symdiff - Symbolic differentiation for Tcl
SYNOPSIS
package require Tcl 8.5
package require grammar::aycock 1.0
package require math::calculus::symdiff 1.0
math::calculus::symdiff::symdiff expression variable
math::calculus::jacobian variableDict
_________________________________________________________________
DESCRIPTION
The math::calculus::symdiff package provides a symbolic differentiation facility for Tcl math expressions. It is useful for providing de-
rivatives to packages that either require the Jacobian of a set of functions or else are more efficient or stable when the Jacobian is pro-
vided.
PROCEDURES
The math::calculus::symdiff package exports the two procedures:
math::calculus::symdiff::symdiff expression variable
Differentiates the given expression with respect to the specified variable. (See Expressions below for a discussion of the subset of
Tcl math expressions that are acceptable to math::calculus::symdiff.) The result is a Tcl expression that evaluates the derivative.
Returns an error if expression is not a well-formed expression or is not differentiable.
math::calculus::jacobian variableDict
Computes the Jacobian of a system of equations. The system is given by the dictionary variableDict, whose keys are the names of
variables in the system, and whose values are Tcl expressions giving the values of those variables. (See Expressions below for a
discussion of the subset of Tcl math expressions that are acceptable to math::calculus::symdiff. The result is a list of lists: the
i'th element of the j'th sublist is the partial derivative of the i'th variable with respect to the j'th variable. Returns an error
if any of the expressions cannot be differentiated, or if variableDict is not a well-formed dictionary.
EXPRESSIONS
The math::calculus::symdiff package accepts only a small subset of the expressions that are acceptable to Tcl commands such as expr or if.
Specifically, the only constructs accepted are:
o Floating-point constants such as 5 or 3.14159e+00.
o References to Tcl variable using $-substitution. The variable names must consist of alphanumerics and underscores: the ${...} nota-
tion is not accepted.
o Parentheses.
o The +, -, *, /. and ** operators.
o Calls to the functions acos, asin, atan, atan2, cos, cosh, exp, hypot, log, log10, pow, sin, sinh. sqrt, tan, and tanh.
Command substitution, backslash substitution, and argument expansion are not accepted.
EXAMPLES
math::calculus::symdiff::symdiff {($a*$x+$b)*($c*$x+$d)} x
==> (($c * (($a * $x) + $b)) + ($a * (($c * $x) + $d)))
math::calculus::symdiff::jacobian {x {$a * $x + $b * $y}
y {$c * $x + $d * $y}}
==> {{$a} {$b}} {{$c} {$d}}
BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category math ::
calculus of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may
have for either package and/or documentation.
SEE ALSO
math::calculus, math::interpolate
COPYRIGHT
Copyright (c) 2010 by Kevin B. Kenny <kennykb@acm.org>
Redistribution permitted under the terms of the Open Publication License <http://www.opencontent.org/openpub/>
math 1.0 symdiff(3tcl)