Home > Archive > Fortran > October 2006 > Re: Random position on sphere generator -- numerics question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Random position on sphere generator -- numerics question
|
|
| mvukovic@nycap.rr.com 2006-09-06, 7:01 pm |
|
glen herrmannsfeldt wrote:
> Ron Shepard wrote:
>
>
> (snip, someone wrote)
>
>
>
> Common subexpression elimination has been part of optimizing Fortran
> compilers for a long time, including intrinsic functions. Exactly how
> good any particular compilers is at it is always a question. If the
> compiler can figure it out, it has been suggested that it is better to
> let the compiler do it. In this case, though, I agree that a temporary
> variable makes sense to be sure that the expression is always evaluated
> consistently.
>
> -- glen
Are there directives in fortran (not the compiler option switches) to
disable optimization of some parts of the code? Like saying: "leave
this variable alone, don't mess with it"
Mirko
| |
| glen herrmannsfeldt 2006-10-16, 6:59 pm |
| In comp.lang.fortran Ron Shepard <ron-shepard@nospam.comcast.net> wrote:
(I wrote)
[color=darkred]
> The glaring exception, of course, is integer division when one or
> both arguments are negative. The fortran language has always
> defined what the result should be;
I thought this was relatively new for Fortran. It might
also be in C99 (I haven't looked at C99 much yet).
C carefully allows binary twos complement, ones complement,
or sign magnitude. That sometimes results in differences
in signed operations. It also affects the results of the
shift operators.
Fortran not only allows for radix complement, digit
complement, and sign magnitude binary, but in any base
greater than one.
-- glen
|
|
|
|
|