Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"It ain't over until it's over." -- Casey Stengel


devel / comp.lang.fortran / Re: print '(E330.320)', huge(1.d0)

SubjectAuthor
* Re: print '(E330.320)', huge(1.d0)Ron Shepard
`- Re: print '(E330.320)', huge(1.d0)gah4

1
Re: print '(E330.320)', huge(1.d0)

<3A%SL.1988509$vBI8.1726861@fx15.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3307&group=comp.lang.fortran#3307

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.9.0
Subject: Re: print '(E330.320)', huge(1.d0)
Content-Language: en-US
References: <md5:gJNpo26DYvv25H7uk6RwEQ==>
Newsgroups: comp.lang.fortran
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <md5:gJNpo26DYvv25H7uk6RwEQ==>
X-Forwarded-Message-Id: <md5:gJNpo26DYvv25H7uk6RwEQ==>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 36
Message-ID: <3A%SL.1988509$vBI8.1726861@fx15.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Thu, 23 Mar 2023 11:59:43 -0500
X-Received-Bytes: 2784
 by: Ron Shepard - Thu, 23 Mar 2023 16:59 UTC

On 3/22/23 3:21 PM, gah4 wrote:
> On Wednesday, March 22, 2023 at 9:19:07 AM UTC-7, Ron Shepard wrote:
>> On 3/20/23 3:50 PM, Peter Klausler US wrote:
>>> On Monday, March 20, 2023 at 1:03:44 PM UTC-7, Steve Lionel wrote:
>>>> Why do you assume that huge(1.0d0) is exactly representable in decimal?
>
>>> Because every finite binary floating-point number has an exact decimal value.
>> Also, every floating point number larger than 1/epsilon has a
>> mathematical integer value (which of course cannot usually be
>> represented as a fortran integer). The ones with large exponents have
>> lots of trailing zeros.
>
> But why do you believe they are trailing zeros?

You are right. The trailing zeros are binary zeros in the internal
representation, not necessarily decimal zeros after the output conversion.

The discussions about significant digits only apply to this problem in a
specific way, and in fact apply to both fixed point and floating point
arithmetic. As taught in school, it is usually applied to fixed point
arithmetic done by hand. But with floating point in a computer, each
value that is represented has an exact value. The specific way that
significant digits apply is that the fortran processor converts that
exact value to a decimal representation, and that conversion need not be
exact. The rounding mode specified in the open statement determines how
the inexact situations are treated (see 13.7.2.3.8). However, most of
that discussion is related to how the internal representation is
determined from the exact value on input, not the other way around. Is
there another section in the standard that also covers this output
conversion process?

In addition to the ew.d fields that are being discussed here, output
fields like fw.d or even f0.d can produce very long output strings with
dozens or hundreds of digits.

$.02 -Ron Shepard

Re: print '(E330.320)', huge(1.d0)

<dc68a774-0efa-473e-9026-70f33984405an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=3308&group=comp.lang.fortran#3308

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:57c2:0:b0:3e3:db7d:da45 with SMTP id w2-20020ac857c2000000b003e3db7dda45mr292806qta.2.1679604162124;
Thu, 23 Mar 2023 13:42:42 -0700 (PDT)
X-Received: by 2002:a05:620a:4516:b0:745:da3d:ccf4 with SMTP id
t22-20020a05620a451600b00745da3dccf4mr90404qkp.0.1679604161885; Thu, 23 Mar
2023 13:42:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Thu, 23 Mar 2023 13:42:41 -0700 (PDT)
In-Reply-To: <3A%SL.1988509$vBI8.1726861@fx15.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:2d24:8269:49a:3253;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:2d24:8269:49a:3253
References: <md5:gJNpo26DYvv25H7uk6RwEQ==> <3A%SL.1988509$vBI8.1726861@fx15.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <dc68a774-0efa-473e-9026-70f33984405an@googlegroups.com>
Subject: Re: print '(E330.320)', huge(1.d0)
From: gah4@u.washington.edu (gah4)
Injection-Date: Thu, 23 Mar 2023 20:42:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3428
 by: gah4 - Thu, 23 Mar 2023 20:42 UTC

On Thursday, March 23, 2023 at 9:59:47 AM UTC-7, Ron Shepard wrote:

(snip)

> The discussions about significant digits only apply to this problem in a
> specific way, and in fact apply to both fixed point and floating point
> arithmetic. As taught in school, it is usually applied to fixed point
> arithmetic done by hand. But with floating point in a computer, each
> value that is represented has an exact value. The specific way that
> significant digits apply is that the fortran processor converts that
> exact value to a decimal representation, and that conversion need not be
> exact. The rounding mode specified in the open statement determines how
> the inexact situations are treated (see 13.7.2.3.8). However, most of
> that discussion is related to how the internal representation is
> determined from the exact value on input, not the other way around. Is
> there another section in the standard that also covers this output
> conversion process?
In reply to a question about Fortran expression precision, the reply
was that it was legal for all floating point expressions to have
the value 42. That would not be a high quality implementation.

Significant digits definitely applies when a calculator is used,
and should also for a computer. They are a way to show
uncertainty, when one isn't up to giving it an actual
value.

Now I can explain the actual question that got the 42 result.
In Fortran single precision multiply gives a single
precision result. IBM S/360 and S/370 multiply
instruction gives a double precision result.
(MEER was added to ESA/390 many years later.)
Compilers I know generate the extra instructions
to zero the rest of the bits. It seems that Fortran
doesn't require that, though.

The Intel 8087 most often generates full width
product in registers, but will store values as
specified. That matters when optimizers
keep values in registers. Even more, they
can store some and not others.

In any case, you are free to believe that floating
point values have an infinite number of trailing
decimal or binary zeros. You may or may not
find that in actual use.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor