• Re: USB card adapters crash Pi4

    From =?UTF-8?Q?Bj=c3=b6rn_Lundin?=@3:770/3 to All on Sat Jan 23 23:03:39 2021
    Den 2021-01-04 kl. 04:17, skrev The Natural Philosopher:
    On 03/01/2021 19:15, Charlie Gibbs wrote:
    On 2021-01-03, Joe <joe@jretrading.com> wrote:

    On Sun, 03 Jan 2021 15:41:04 GMT
    Jan Panteltje <pNaOnStPeAlMtje@yahoo.com> wrote:

      I use an asm math library written by someone else,
    so far 32 bit integer was all I needed,

      "If you need to use floating-point arithmetic in FORTH,
      you do not fully understand your application"

    Not sure if it was Charles Moore or Leo Brodie who said that.

    It makes sense, though, depending on your applications.
    In 50 years of commercial programming, I can count the
    number of times I've used floating point on the fingers
    of one hand.

    Odd. I use it extensively. Not for money oriented stuff tho


    Money should use Fixed type. <https://en.wikipedia.org/wiki/Fixed-point_arithmetic#Computer_language_implementations>


    --
    Björn

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Martin Gregorie@3:770/3 to All on Sat Jan 23 22:54:30 2021
    On Sat, 23 Jan 2021 23:03:39 +0100, Björn Lundin wrote:

    Den 2021-01-04 kl. 04:17, skrev The Natural Philosopher:
    On 03/01/2021 19:15, Charlie Gibbs wrote:
    On 2021-01-03, Joe <joe@jretrading.com> wrote:

    On Sun, 03 Jan 2021 15:41:04 GMT Jan Panteltje
    <pNaOnStPeAlMtje@yahoo.com> wrote:

      I use an asm math library written by someone else,
    so far 32 bit integer was all I needed,

      "If you need to use floating-point arithmetic in FORTH,
      you do not fully understand your application"

    Not sure if it was Charles Moore or Leo Brodie who said that.

    It makes sense, though, depending on your applications.
    In 50 years of commercial programming, I can count the number of times
    I've used floating point on the fingers of one hand.

    Odd. I use it extensively. Not for money oriented stuff tho


    Money should use Fixed type.
    <https://en.wikipedia.org/wiki/Fixed-
    point_arithmetic#Computer_language_implementations>

    Depends: Thats OK for a single currency system, but if you need to handle multi-currency, then you need at least three variables to describe a
    financial amount:

    long int value;
    int decimalPlace;
    String currencyName;

    where value is the value in the smallest legal unit (pence for GBP, cents
    for Euros or dollars and decimalPlace (2 for GBP and most other
    currencies, though IIRC there are a few that use 3 decilal places, is
    only used when converting to or from human-readable strings.

    In practise you may need quite a complex currency parser, because a lot
    of bankers and finance traders would expect the system to understand,
    say, USD1.5M as meaning "$1,500,000.00 US" and would expect to use that shorthand notation when entering payment details and to get the amount displayed the same way if they need to amend it later.

    ====

    And yet, way back when having a PC with an 8086 in it was a sign of
    status, and PC financial programs where written in BASIC, the use of
    floating point for financial values was fairly common - but only because
    a 16 bit signed integer topped out at a mere GBP 327.68 OR were achingly
    slow because they had to use BCD or decimal encoded monetary values.

    The Mainframes I've worked on have ALWAYS used integers for financial
    values, though quite a lot of the weedier bottom-of-the-range IBM boxes
    used BCD - but at least they had BCD hardware and didn't have to do calculations entirely in software.


    --
    --
    Martin | martin at
    Gregorie | gregorie dot org

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Pancho@3:770/3 to Martin Gregorie on Sat Jan 23 23:31:47 2021
    On 23/01/2021 22:54, Martin Gregorie wrote:

    Money should use Fixed type.
    <https://en.wikipedia.org/wiki/Fixed-
    point_arithmetic#Computer_language_implementations>

    Depends: Thats OK for a single currency system, but if you need to handle multi-currency, then you need at least three variables to describe a financial amount:


    For Financial derivative risk systems, it is still almost exclusively float(double) representation for money. The exponential function is
    frequently used in calculations and it works with doubles. Hence the
    added complexity of converting between doubles and decimals far
    outweighs any benefit.

    BTW thank you for the awk idea the other day. If I whinge on about an
    idea for days, it means I like it. I'm a bit of a sperg when it comes to
    social graces.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Dennis Lee Bieber@3:770/3 to All on Sat Jan 23 18:30:25 2021
    On Sat, 23 Jan 2021 22:54:30 -0000 (UTC), Martin Gregorie <martin@mydomain.invalid> declaimed the following:

    The Mainframes I've worked on have ALWAYS used integers for financial
    values, though quite a lot of the weedier bottom-of-the-range IBM boxes
    used BCD - but at least they had BCD hardware and didn't have to do >calculations entirely in software.

    Even the old Intel 8080a had "BCD hardware" -- but one would have to write the algorithm to work with more than two BCD digits.

    My college computer (Xerox Sigma-6) had BCD hardware. The normal mode used by the COBOL class was BCD (note: Sigma's also used the EBCDIC
    character encoding), 32-digit, using four of the 32-bit general purpose registers at a time. I recall the fall when the BCD board failed -- COBOL students were left twiddling their thumbs or trying to code work-arounds (possibly one of the COMP formats that did not use BCD), whereas the
    FORTRAN-IV students were not impacted. Think it took almost half the term before the BCD board was replaced.


    --
    Wulfraed Dennis Lee Bieber AF6VN
    wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)