Re: Adding int to a float



Martin Gregorie wrote:
If you're doing financial calculations you should always use integer arithmetic because this avoids nasty surprises due to the inability of floating point to accurately represent all possible values. This also applies to currency conversion. All FX dealing institutions and markets specify precisely how to handle the conversion: using floating point doesn't figure in their rules.

All reputable financial software uses integers with monetary values held in the smallest legal unit in the currency (cents in $US and Euros, pence in the UK).

I think integers needs to be interpreted broad here.

If it covers binary integers and BCD with either application
managed decimal or encapsulated in the data type decimal, then
I agree.

But money is definitely not always store in datatypes equivalent
to Java int.

Arne
.



Relevant Pages

  • ~~~~~~~~~~~~~~ US CURRENCY ~~~~~~~~~~~~~~
    ... $10,000 bill us currency ... amsterdam currency exchange us dollar ... austalian currency conversion to us dollars ... brazilian us currency exchange rate ...
    (uk.rec.walking)
  • Re: Bizarre behavior with percentage fields !
    ... The second issue has to do with how computers handle floating point numbers. ... The solution might be to use a fixed point number such as Currency instead. ... Divide the value by 100 if no percent sign found. ... If Err.Number 2185 Then 'No Text property unless control has focus. ...
    (microsoft.public.access.forms)
  • Re: IEEE Decimal Float on Itanium
    ... Looks like IBM has the lead on everyone ... I too have used binary integers for years in such situations, ... hardware support on VAX, but which we do in runtime on Alpha, another Alpha ... WADU, binary is not the problem, the floating point is. ...
    (comp.os.vms)
  • Re: Currency or Double for currency values
    ... Joe, ... >>> I have a table here that will store currency values. ... >>> floating point number problem. ... >>> Thanks for enlightenment. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Currency or Double for currency values
    ... > Currency doesn't have the floating point problem that double has. ... CURRENCY is proprietary to MS Jet. ... MS SQL Server's MONEY. ...
    (microsoft.public.access.tablesdbdesign)