solving for m
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.fortran Profile…
 Up
solving for m         


Author: Ron Ford
Date: Jul 27, 2008 14:48

I've hit a little snag in solving for Potenz instead of o :

program wahr1

integer :: m, n, anzahl, Potenz
real :: o, p

n = 8
m = n - 1
Potenz = 23

o = (1 - (m*1.0/n*1.0)**Potenz)
print *, o

end program
! gfortran -o wahr wahr1.f03

I need to pull a root that could be expressed in terms of integers or a
real. I've read before that real**real has performance problems, but they
would only be time-related, right?

How do I solve for Potenz when o is .95?
Show full article (0.64Kb)
4 Comments
Re: solving for m         


Author: Steven G. Kargl
Date: Jul 27, 2008 15:27

In article 40tude.net>,
Ron Ford nowhere.net> writes:
>
> I've hit a little snag in solving for Potenz instead of o :
>
> program wahr1
>
> integer :: m, n, anzahl, Potenz
> real :: o, p
>
> n = 8
> m = n - 1
> Potenz = 23
>
> o = (1 - (m*1.0/n*1.0)**Potenz)
> print *, o
>
>
> end program
> ! gfortran -o wahr wahr1.f03 ...
Show full article (0.75Kb)
no comments
Re: solving for m         


Author: Ron Ford
Date: Jul 27, 2008 21:19

On Sun, 27 Jul 2008 22:27:40 +0000 (UTC), Steven G. Kargl posted:
> In article 40tude.net>,
> Ron Ford nowhere.net> writes:
>>
>> I need to pull a root that could be expressed in terms of integers or a
>> real. I've read before that real**real has performance problems, but they
>> would only be time-related, right?
>>
>> How do I solve for Potenz when o is .95?
>
>
> I must be missing something because
>
> Potenz = log(1 - o) / log(real(m) / n)

Thanks, Steve, that seems to work. My subject line was errant.

The question came up in the context of the random signatures for my
newsreader, which is Dialog. I'd noticed what I considered to be a
periodicity in it and wanted to prove that the results I was seeing were 95
%% unlikely.
Show full article (1.94Kb)
no comments
Re: solving for m         


Author: Gordon Sande
Date: Jul 28, 2008 06:21

On 2008-07-27 18:48:01 -0300, Ron Ford nowhere.net> said:
>
> I've hit a little snag in solving for Potenz instead of o :
>
> program wahr1
>
> integer :: m, n, anzahl, Potenz
> real :: o, p
>
> n = 8
> m = n - 1
> Potenz = 23
>
> o = (1 - (m*1.0/n*1.0)**Potenz)

Curious form of bracketing!

(m*1.0/n*1.0) is the same as ((((m)*1.0)/n)*1.0)

Were you thinking it might be ( (m*1.0) / (n*1.0) ) which is accidentally
the same numerically only because 1.0 equals 1.0/1.0.
Show full article (1.09Kb)
no comments
Re: solving for m         


Author: Ron Ford
Date: Jul 28, 2008 13:00

On Mon, 28 Jul 2008 13:21:13 GMT, Gordon Sande posted:
Show full article (1.22Kb)
no comments