LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-22-2009, 02:30 PM   #1
Tahir Butt
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Rep: Reputation: 0
Fortran 90 - intrinsic function SUM...works for double precision?


I would like to know if the intrinsic function SUM for arrays is capable of handling both single and double precision values in Fortran 90.

So would the following be appropriate usage (where array is declared as type REAL)?

SUM(dble(array)) -double precision
SUM (array) -single precision

There is some confusion because for other generic functions in the past we have used two versions

abs -single precision
dabs -double precision
 
Old 04-22-2009, 10:24 PM   #2
rriggs
Member
 
Registered: Mar 2009
Location: Colorado, US
Distribution: Fedora 13, Fedora 14, RHEL6 Beta
Posts: 46

Rep: Reputation: 17
Surely there has to be a better place to post questions about GNU FORTRAN than this site. No offense. :-)
 
Old 06-14-2009, 09:20 AM   #3
telemeister
Member
 
Registered: Dec 2007
Location: Brisbane Australia
Distribution: Slackware
Posts: 60

Rep: Reputation: 16
Tahir..

I certainly dont have a problem with you asking this question on this forum...
Last time I checked it was called the 'programming' forum.

(rrigs.. maybe you can clarify why you are unhappy with this??)


Anyway to answer the question.

SUM works fine with either REAL or DOUBLE PRECISION arguments.

Hope that helps

Steve
 
Old 06-15-2009, 09:52 PM   #4
rriggs
Member
 
Registered: Mar 2009
Location: Colorado, US
Distribution: Fedora 13, Fedora 14, RHEL6 Beta
Posts: 46

Rep: Reputation: 17
Quote:
Originally Posted by telemeister View Post
(rrigs.. maybe you can clarify why you are unhappy with this??)
Hi Steve,

I wasn't unhappy with it at all. This just didn't seem the place where a quick answer would be forthcoming. Surely there is a forum or two on the 'net dedicated to answering Fortran questions.

Regards,

Rob
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call PGPLOT function in FORTRAN code? lengyue Linux - Software 26 12-09-2009 06:36 AM
higher precision than double justaguy_75ae Programming 4 01-13-2009 07:12 AM
bash and double precision babag Programming 10 04-20-2008 05:19 PM
how to call C function in FORTRAN program bigapple Programming 5 08-24-2005 01:30 AM
fortran 77 precision buddy_epson Programming 0 07-19-2003 04:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration