Re: [RFC] decimal float point patch based on libdecnumber: testcase

Daniel Jacobowitz
2006-06-22T20:25:04Z

Hi Wu,

By and large this looks very good. There are a couple of minor
formatting issues, which I'll run through for you when I get a chance
if no one else does; it may not be until after the GCC Summit next
week, though.

Moving libdecnumber into src is a bit tricky. I'll take care of that
when we're ready for the patch. It also has to go into src-release,
CVSROOT/modules, and some dependencies in Makefile.def. So don't worry
about that.

I did have one question for you. This struck me as strange...

On Thu, Jun 22, 2006 at 05:03:34AM +0800, Wu Zhou wrote:
> + # _Decimal64 constants, which can support up to 16 digits
> + gdb_test "p 1.2dd" " = 1.2"
> + gdb_test "p -1.2dd" " = -1.2"
> + gdb_test "p 1.234567890123456dd" " = 1.234567890123456"
> + gdb_test "p -1.234567890123456dd" " = -1.234567890123456"
> + gdb_test "p 1234567890123456.dd" " = 1234567890123456"
> + gdb_test "p -1234567890123456.dd" " = -1234567890123456"
> +
> + gdb_test "p 1.2E1dd" " = 12"
> + gdb_test "p 1.2E10dd" " = 1.2E\\+10"

If "p 1234567890123456.dd" prints it back with digits, why does "p
1.2E10dd" print it back with an exponent? Which would
"p 1200000000000000.dd" do?

> +proc test_arithmetic_expressions {} {
> +
> +# Arithmetic operations for DFP types are not yet implemented in GDB.
> +
> +}

Might want some tests for whatever does happen if you try it, in the
meantime. It should give a sensible error message.

--
Daniel Jacobowitz
CodeSourcery