Welcome to iraf.net Friday, May 17 2024 @ 09:57 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Absolute value of a number
   
piverson
 04/27/2008 02:36PM (Read 3482 times)  
+++--
Chatty

Status: offline


Registered: 07/10/2007
Posts: 42
Mike-This is a dumb question, but is there an absolute value command for real numbers in IRAF? I have thought about importing the abs() command from linux but all comments say that it only works with int (I thought this was weird). I can get around the issue, quick and dirty, with if statements but would prefer the elegance of a simple command.Thanks.-Paul

 
Profile Email
 Quote
fitz
 04/27/2008 02:36PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
[code:1:2f4f926d8b]
ecl> =abs(-1.2)
1.2
ecl> print (abs(-3.14))
3.14
[/code:1:2f4f926d8b]-Mike

 
Profile Email
 Quote
piverson
 04/27/2008 02:36PM  
+++--
Chatty

Status: offline


Registered: 07/10/2007
Posts: 42
Mike-Is there an easy way to calculate the square root of a number in IRAF?Thanks.-Paul

 
Profile Email
 Quote
fitz
 04/27/2008 02:36PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Use sqrt()See the $iraf/doc/clman.ms doc for a list of available functions but in general it is what you'd expect.-Mike

 
Profile Email
 Quote
piverson
 04/27/2008 02:36PM  
+++--
Chatty

Status: offline


Registered: 07/10/2007
Posts: 42
Thanks Mike.I don't know what happened from the time I posted until the time you replied. We tried the =sqrt() command but it didn't work until you said to try it. (Craig thinks that you must have some remote connection to our IRAF installation and added that task for us so that we could feel really stupid).In all seriousness though thanks again.

 
Profile Email
 Quote
   
Content generated in: 0.16 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login