Welcome, Guest. Please login or register.

Author Topic: Decimal Floating Point and Abstraction Layer  (Read 4529 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline tonydTopic starter

  • Newbie
  • *
  • Join Date: Jun 2014
  • Posts: 14
    • Show all replies
Decimal Floating Point and Abstraction Layer
« on: March 23, 2016, 11:58:56 AM »
Planning to try OS4.1FE Classic with UAE shortly....
Forgive me if they already have this....

What is the state of decimal floating points on the Amiga?  I think this is important for future development, and if we don't have it, we could have an abstraction layer, such as IBM developed for PPC (http://speleotrove.com/decimal/dfpal/dfpalugaio.html).  Might this very library work or be easy to adapt to the Amiga?

The abstraction layer (DFPAL) allows you to use the decimal types whether the hardware natively supports it or not.  If the hardware supports it, the abstraction software will use that, and it will be much faster, but if the hardware does not support it, the code still executes and gives the same results, though slower.

Also, I hope they'll follow the IEEE interchange format.  The interchange format not only specifies the parts, but also their order, so that it's easy for anyone to read and write the same format (https://en.wikipedia.org/wiki/IEEE_floating_point#Basic_and_interchange_formats).
« Last Edit: March 23, 2016, 12:56:51 PM by tonyd »
 

Offline tonydTopic starter

  • Newbie
  • *
  • Join Date: Jun 2014
  • Posts: 14
    • Show all replies
Not "Lossy" -- Re: Decimal Floating Point and Abstraction Layer
« Reply #1 on: March 24, 2016, 12:12:53 AM »
Quote from: psxphill;806253
Floating point is a lossy compression algorithm.

@psxphill: Decimal floating point is not a lossy compression algorithm.  Binary floating point can be lossy, because some decimal numbers can't be accurately represented.  That's why we need the decimal floating point type.

@olsen: Yeah, it's used where accuracy is most important.  I can't tell for sure, but I think you're referring to IEEE 754 as only defining a binary floating point standard.  Actually, it defines both binary and decimal types (https://en.wikipedia.org/wiki/IEEE_floating_point).

I'm a big fan of standardization when the standard makes sense, and it seems to me that this one does, though I'm still learning about it.  Binary floating point has been in the hardware for some time now, and decimal floating point is being added to modern processors.  I need to do more research, but it's probably according to this standard.

It seems that the IEEE standard for decimal is better than the Java BigDecimal (http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf), and probably better than the C# decimal (but I haven't verified that one).  There is a move to add decimal to C (http://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html) and to C++ (http://open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3871.html).

Mike Cowlishaw seems to have a very good and informative site on the subject (http://speleotrove.com/decimal/).
« Last Edit: March 24, 2016, 03:30:25 AM by tonyd »
 

Offline tonydTopic starter

  • Newbie
  • *
  • Join Date: Jun 2014
  • Posts: 14
    • Show all replies
Re: Not "Lossy" -- Re: Decimal Floating Point and Abstraction Layer
« Reply #2 on: March 24, 2016, 11:47:03 AM »
@Thomas: I believe there's a place for binary as well.  I wasn't saying there isn't.  It depends upon your purpose.

Quote
Neither binary nor decimal floating point can reprenset 1/3 or 1/7 precisely.
Fractions aren't the issue.

Quote
Is anyone really using decimal in hardware these days?
It's been in IBM POWER processors since the POWER6.  I imagine it's in the Amiga's new processors, but need to confirm.
(Correcting myself.... In my zeal, I accidentally overstated this case.  It's current hardware implementations include POWER, SparcX, z10, and some kind of processor from SilMinds.)

Quote
then this is usually in software
That's because it wasn't available in the hardware.  It's being done in software because it's needed.

Quote
Binary is more precise than decimal.
Not  if you're trying to represent decimal numbers.  For example, there's no  precise representation for decimal 0.1 in binary.  Within a certain  amount of precision, decimal floating point can perfectly represent a  decimal number.  That can't be said about binary floating point numbers.
« Last Edit: March 24, 2016, 10:04:13 PM by tonyd »