Re: Display Engineering Notation with SI Prefix

Liste des GroupesRevenir à cl forth 
Sujet : Re: Display Engineering Notation with SI Prefix
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 29. Aug 2024, 13:39:20
Autres entêtes
Organisation : Ausics - https://newsgroups.ausics.net
Message-ID : <66d06bf8@news.ausics.net>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 29/08/2024 8:39 pm, mhx wrote:
On Thu, 29 Aug 2024 10:02:26 +0000, dxf wrote:
 
On 29/08/2024 1:32 am, dxf wrote:
[..]
The real (FE.) has no such issues and works as expected ...
>
VFX Forth 64 for Windows x64
  © MicroProcessor Engineering Ltd, 1998-2023
>
 Version: 5.43 [build 4241]
 Build date: 22 December 2023
>
2 set-precision  ok
1.234e 1e2 f* -1 (fe.) type 120.E0 ok
 
Using the non-standard set-precision of iForth:
 
FORTH> 2 set-precision 1.234e f. 1.23  ok
FORTH> 1 set-precision 1.234e f. 1.2  ok
FORTH> 3 set-precision 1.234e f. 1.234  ok
FORTH> 3 set-precision 1234e  f. 1234.000  ok
FORTH> 0 set-precision 1234e  f. 1234  ok

So iForth PRECISION equates to 'decimal places'.  In VFX 'decimal
places' is achieved thus:

1.234e 2 0 f.r 1.23 ok
1.234e 1 0 f.r 1.2 ok
1.234e 3 0 f.r 1.234 ok
1234e  3 0 f.r 1234.000 ok
1234e  0 0 f.r 1234. ok

PRECISION only comes into effect in 'significant digits' mode:

3 set-precision

1.234e -1 0 f.r 1.23 ok
12.34e -1 0 f.r 12.3 ok
123.4e -1 0 f.r 123. ok
1234.e -1 0 f.r 1230. ok

or simply:

1.234e f. 1.23  ok
12.34e f. 12.3  ok
123.4e f. 123.  ok
1234.e f. 1230.  ok
 
Didn't F83 have DIGITS ?

Neither Laxen/Perry F83 nor Forth-83 had floating point.  You may be
thinking of PLACES from 'The Forth Vendors Group Standard Floating
Point Extension' (?)  That was initially considered by the ANS-TC and
documented in BASIS17:

  12.1.2032   PLACES 

  ( u -- )

  Set the number of decimal places (digits to the right of the radix
  point) displayed by E. and F.

PLACES would be synonymous with your PRECISION .

Has any language other that Forth opted for 'significant digits' over
(or in addition to) 'decimal places'?  The former seems particularly
suited to engineering.


Date Sujet#  Auteur
28 Aug 24 * Display Engineering Notation with SI Prefix11dxf
29 Aug 24 `* Re: Display Engineering Notation with SI Prefix10dxf
29 Aug 24  `* Re: Display Engineering Notation with SI Prefix9mhx
29 Aug 24   `* Re: Display Engineering Notation with SI Prefix8dxf
29 Aug 24    `* Re: Display Engineering Notation with SI Prefix7mhx
30 Aug 24     `* Re: Display Engineering Notation with SI Prefix6dxf
30 Aug 24      `* Re: Display Engineering Notation with SI Prefix5mhx
30 Aug 24       `* Re: Display Engineering Notation with SI Prefix4dxf
30 Aug 24        `* Re: Display Engineering Notation with SI Prefix3mhx
30 Aug 24         `* Re: Display Engineering Notation with SI Prefix2dxf
31 Aug 24          `- Re: Display Engineering Notation with SI Prefix1dxf

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal