PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > Re: Bug/Gross InEfficiency in HeathField's fgetline program
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: Bug/Gross InEfficiency in HeathField's fgetline program

Réponse
 
LinkBack Outils de la discussion
Vieux 06/11/2007, 22h48   #126
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

Flash Gordon said:

> Richard Heathfield wrote, On 06/11/07 13:34:
>> Flash Gordon said:
>>
>> <snip>
>>
>>> I don't think that Richard believes he is always correct.

>>
>> Interesting philosophical point there, Flash! :-)
>>
>> As a matter of fact, I *do* think I'm correct, for the obvious reason
>> that, if I thought I were /in/correct, naturally I would modify my
>> position. (Doesn't everyone think that way?)

>
> <snip>
>
> You have misinterpreted my statement. I didn't say that you don't always
> believe you are correct, I said that you don't believe you are always
> correct. I.e. I stated that I believe you know that you are not perfect
> and are sometimes incorrect, not that you state things that you believe
> you are incorrect at the time you state them.


I sit corrected. And now that I understand what you meant, I agree.

I must take issue with santosh's response, though - your response was not
hair-splitting. It clarified an important distinction between two very
different ideas.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
  Réponse avec citation
Vieux 07/11/2007, 02h00   #127
Tor Rustad
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

Flash Gordon wrote:
> Tor Rustad wrote, On 06/11/07 11:38:


[...]

> This means that the only way to convert money from one currency
> to another is to move it from one account to another, and


We call this a transaction, which typically is done with double-entry
bookkeeping.

> at that point the rounding occurs as part of the conversion using
> defined rules and a specified conversion rate,


"I'm struggling to imagine any real-world double-entry-relevant
calculation that /cannot/ be done exactly."
-RH

> and those rules specify *exactly* what will be credited to one
> account and debited from the other.


The whole point, is that this calculation uses rounding. Do UK accounts
have two decimal places?

>> The obvious requirement our UK bank has, will be to match each account
>> at some cut-off times each day. This calculation should be done
>> *exactly*. If the currency conversion has already been done at this
>> point, there is no simple way to match the books *exactly*.

>
> Incorrect, it is easy as long as you follow the requirements above.


Nothing you said, invalidated my statement here...

> If anyone is interested enough I could ask one of my brothers who was
> doing application support & maintenance for one of the large
> organisations in the City of London that works with lots of currencies.


I have been trying to leave this thread for some time...

Anyway, some details from an insider is very interesting. In particular,
a related problem, how UK banks can implement SEPA w.r.t. double-entry
bookkeeping and risk management.

In this case, the transactions will be in euro, while the EU payment
scheme rulebook say nothing about possible currency conversion, or the
related risks for the banks.

> I don't think that Richard believes he is always correct.


Neither did I. ;-)

--
Tor <bwzcab@wvtqvm.vw | tr i-za-h a-z>
  Réponse avec citation
Vieux 07/11/2007, 03h26   #128
Charlie Gordon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

"user923005" <dcorbit@connx.com> a écrit dans le message de news:
1194376694.747864.228290@o38g2000hse.googlegroups. com...
> On Nov 5, 3:40 pm, Richard Heathfield <r...@see.sig.invalid> wrote:
>> user923005 said:
>>
>> > On Nov 3, 2:54 pm, Richard Heathfield <r...@see.sig.invalid> wrote:
>> >> [...] the introduction of a discussion of
>> >> multiple currencies blurred the issue in my mind for a little while.
>> >> Taking a step back and thinking about it, I realised it represented a
>> >> completely separate issue.

>>
>> >> I still stand by my statement that you can do double-entry
>> >> book-keeping
>> >> *exactly*.

>>
>> > I disagree. If there are any rational or exponential calculations,
>> > then it is not possible.
>> > Examples:
>> > Depreciation calculations
>> > Interest calculations
>> > Investments (Future value, Present value, Annuities...)

>>
>> Yes, but it's the same blurring. The "how much interest should be added?"
>> question cannot be answered exactly (except by chance, of course) - it
>> must be rounded. But double-entry book-keeping is about putting one
>> *monetary* amount into two ledgers, once on the debit side and once on
>> the
>> credit side. This can be done exactly.

>
> I agree that the credit and the debit will agree. But the amount
> stored is not exact. There have been schemes based on stealing these
> fractional pennies that have netted huge sums over time.


This is akin to gleaning, which was not considered stealing in ancient
times.
These fractional pennies cannot be credited to cash deposit account holders,
is the bank stealing them ?

--
Chqrlie.


  Réponse avec citation
Vieux 07/11/2007, 22h14   #129
RoS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

In data 06 Nov 2007 09:43:14 +0100, Jean-Marc Bourguet scrisse:
>user923005 <dcorbit@connx.com> writes:
>
>> > I still stand by my statement that you can do double-entry book-keeping
>> > *exactly*.

>>
>> I disagree. If there are any rational or exponential calculations,
>> then it is not possible.
>> Examples:
>> Depreciation calculations
>> Interest calculations
>> Investments (Future value, Present value, Annuities...)

>
>My impression was that there are reglementary texts who precise exactly how
>those should be computed, included the rounding rules.
>
>BTW, I doubt very much that they have any relationship with the rounding
>rules of any implementation of floating point, even decimal FP. And we
>know the problems caused by double rounding.


i don't know them...
can you please to give one simple example of it?

>Yours,

  Réponse avec citation
Vieux 07/11/2007, 22h15   #130
Malcolm McLean
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program


"Tor Rustad" <tor_rustad@hotmail.com> wrote in message
news:StCdnbQd_pzXk6zaRVnzvQA@telenor.com...
> Flash Gordon wrote:
>> Tor Rustad wrote, On 06/11/07 11:38:

>
>> This means that the only way to convert money from one currency to
>> another is to move it from one account to another, and

>
> We call this a transaction, which typically is done with double-entry
> bookkeeping.
>

The only way to convert dollars into pounds is for the bank / the Americans
here to offer to swap their dollars with someone who has pounds. Like me,
except that as a private individual I've no real use for dollars.
You cannot pulp dollars and do a print run of the equivalent amount in
pounds.

It follows that any valuation of, say, a British company's dollar holdings
in pounds is a notional value. Based on market prices, they are saying what
they expect to be able to trade those dollars for. It doesn't differ in that
respect form their valuation of head office, or unsold inventory. Again,
there are rules, but these are best guess amounts that may not actually be
realised.

This has been explained to you in a previous post. Whilst a programmer
cannot be expected to have much understanding of the financial world, it is
not a very edifying sight to see you criticise Richard Heathfield so
vociferously, after you've been told once what the situation is.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

  Réponse avec citation
Vieux 08/11/2007, 02h05   #131
Dik T. Winter
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

In article <vfa4j3d13f4k9reojiq839tcd0k8ompkj5@4ax.com> RoS <Ros@not.exist> writes:
> In data 06 Nov 2007 09:43:14 +0100, Jean-Marc Bourguet scrisse:

....
> >BTW, I doubt very much that they have any relationship with the rounding
> >rules of any implementation of floating point, even decimal FP. And we
> >know the problems caused by double rounding.

>
> i don't know them...
> can you please to give one simple example of it?


If we use bankers rule as I understand it (if the first digit rounded
away is 0 to 4, we round down, otherwise we round up), starting with
0.3476 first to two decimals after the point and then to one decimal
we get first 0.35 and from that we get 0.4. Doing it directly we get 0.3.

And i understand that financial calculation and rounding rules are very
precise in the US.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
  Réponse avec citation
Vieux 12/11/2007, 21h53   #132
Flash Gordon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

Tor Rustad wrote, On 07/11/07 01:00:
> Flash Gordon wrote:
>> Tor Rustad wrote, On 06/11/07 11:38:

>
> [...]
>
>> This means that the only way to convert money from one currency
> > to another is to move it from one account to another, and

>
> We call this a transaction, which typically is done with double-entry
> bookkeeping.


Indeed. We talk about transactions as well :-)

>> at that point the rounding occurs as part of the conversion using
>> defined rules and a specified conversion rate,

>
> "I'm struggling to imagine any real-world double-entry-relevant
> calculation that /cannot/ be done exactly."
> -RH


If you consider the rounding to to be part of the conversion equation
rather than something that is done afterwards then the calculation *is*
done exactly.

>> and those rules specify *exactly* what will be credited to one account
>> and debited from the other.

>
> The whole point, is that this calculation uses rounding.


It is part of the calculation, so the calculation overall is done exactly.

> Do UK accounts
> have two decimal places?


Yes.

>>> The obvious requirement our UK bank has, will be to match each
>>> account at some cut-off times each day. This calculation should be
>>> done *exactly*. If the currency conversion has already been done at
>>> this point, there is no simple way to match the books *exactly*.

>>
>> Incorrect, it is easy as long as you follow the requirements above.

>
> Nothing you said, invalidated my statement here...


I think we have a scoping problem. I consider the equation (restated) to be
100 => 50
101 => 50
102 => 51

You consider it to be
101 => 50.5
With a rounding done after.

>> If anyone is interested enough I could ask one of my brothers who was
>> doing application support & maintenance for one of the large
>> organisations in the City of London that works with lots of currencies.

>
> I have been trying to leave this thread for some time...



Well, on the application my brother was involved in they did use
floating point variables because no other variable type could cope with
the range. They just accepted that there would be errors and ensured
that they were consistent. Personally I think that was the wrong
decision, but...


> Anyway, some details from an insider is very interesting. In particular,
> a related problem, how UK banks can implement SEPA w.r.t. double-entry
> bookkeeping and risk management.


That I don't know.

> In this case, the transactions will be in euro, while the EU payment
> scheme rulebook say nothing about possible currency conversion, or the
> related risks for the banks.


They probably use whatever method they used before the euro :-)

>> I don't think that Richard believes he is always correct.

>
> Neither did I. ;-)


OK, we are all agree Richard makes mistakes. Whether we are talking
about the same Richard is, of course, another matter ;-)
--
Flash Gordon
  Réponse avec citation
Vieux 12/11/2007, 22h29   #133
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

Flash Gordon said:

> Tor Rustad wrote, On 07/11/07 01:00:


<snip>

>>> I don't think that Richard believes he is always correct.

>>
>> Neither did I. ;-)

>
> OK, we are all agree Richard makes mistakes.


Strictly speaking, we all agree that I don't believe he doesn't make
mistakes. That does not mean we all agree that I *do* make mistakes. Maybe
we do, and maybe we don't, but we haven't said so yet.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
  Réponse avec citation
Vieux 13/11/2007, 01h09   #134
Flash Gordon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

Richard Heathfield wrote, On 12/11/07 21:29:
> Flash Gordon said:
>
>> Tor Rustad wrote, On 07/11/07 01:00:

>
> <snip>
>
>>>> I don't think that Richard believes he is always correct.
>>> Neither did I. ;-)

>> OK, we are all agree Richard makes mistakes.

>
> Strictly speaking, we all agree that I don't believe he doesn't make
> mistakes.


OK, can we all agree that I make mistakes?

> That does not mean we all agree that I *do* make mistakes. Maybe
> we do, and maybe we don't, but we haven't said so yet.


Well, I believe that Richard makes mistakes, but I'm not going to state
which Richard I am referring to yet.
--
Flash Gordon
  Réponse avec citation
Vieux 13/11/2007, 06h57   #135
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

Flash Gordon said:

> Richard Heathfield wrote, On 12/11/07 21:29:
>>
>> Strictly speaking, we all agree that I don't believe he doesn't make
>> mistakes.

>
> OK, can we all agree that I make mistakes?


No, I think you're mistaken about that.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
  Réponse avec citation
Vieux 13/11/2007, 19h22   #136
Tor Rustad
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

Richard Heathfield wrote:
> Flash Gordon said:
>
>> Tor Rustad wrote, On 07/11/07 01:00:

>
> <snip>
>
>>>> I don't think that Richard believes he is always correct.
>>> Neither did I. ;-)

>> OK, we are all agree Richard makes mistakes.

>
> Strictly speaking, we all agree that I don't believe he doesn't make
> mistakes. That does not mean we all agree that I *do* make mistakes. Maybe
> we do, and maybe we don't, but we haven't said so yet.


Not quite, when we agreed thinking that Richard didn't beleave he is
always correct, it did follow that we believed Richard will be wrong at
some point in space-time. When this event has occurred, Richard must
have been wrong. Either Richard was right being wrong, or Richard was
wrong believing being wrong.

OTOH, what we all believe now, might have changed, so that require a
whole new discussion. That conclude my views on the matter...

--
Tor <bwzcab@wvtqvm.vw | tr i-za-h a-z>
  Réponse avec citation
Vieux 13/11/2007, 21h52   #137
user923005
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Bug/Gross InEfficiency in HeathField's fgetline program

On Nov 13, 10:22 am, Tor Rustad <tor_rus...@hotmail.com> wrote:
> Richard Heathfield wrote:
> > Flash Gordon said:

>
> >> Tor Rustad wrote, On 07/11/07 01:00:

>
> > <snip>

>
> >>>> I don't think that Richard believes he is always correct.
> >>> Neither did I. ;-)
> >> OK, we are all agree Richard makes mistakes.

>
> > Strictly speaking, we all agree that I don't believe he doesn't make
> > mistakes. That does not mean we all agree that I *do* make mistakes. Maybe
> > we do, and maybe we don't, but we haven't said so yet.

>
> Not quite, when we agreed thinking that Richard didn't beleave he is
> always correct, it did follow that we believed Richard will be wrong at
> some point in space-time. When this event has occurred, Richard must
> have been wrong. Either Richard was right being wrong, or Richard was
> wrong believing being wrong.
>
> OTOH, what we all believe now, might have changed, so that require a
> whole new discussion. That conclude my views on the matter...


I remember clearly when Richard was wrong. It was when he thought
that he was mistaken. He also cut himself once, shaving with Occam's
razor. Seriously, Richard Heathfield is one of the frequent posters
to news:comp.lang.c who knows a lot about the C language. I have
learned things from Richard's posts on many occasions. He has a very
wry and dry sense of British humor that sometimes goes over everyone's
head, including mine.

I suspect that the topicality has had a wee bit of drift here.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h15.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,21161 seconds with 20 queries