Files
mercury/tests/mmc_make/complex_test.exp
Ralph Becket 427c7518ec Improve the readability of float output from the debugger and io.print etc.
Estimated hours taken: 4
Branches: main

Improve the readability of float output from the debugger and io.print etc.
by pruning redundant trailing zeroes.

NEWS:
	Mention the change.

library/string.m:
runtime/mercury_float.c:
	Make string.float_to_string trim redundant trailing zeroes.
	The behaviour of string.format etc. is unchanged.

tests/debugger/ambiguity.exp:
tests/debugger/field_names.exp:
tests/debugger/higher_order.exp:
tests/debugger/print_table.exp:
tests/hard_coded/common_type_cast.exp:
tests/hard_coded/constant_prop_1.exp:
tests/hard_coded/construct_test.exp:
tests/hard_coded/deconstruct_arg.exp:
tests/hard_coded/deep_copy.exp:
tests/hard_coded/deep_copy_exist.exp:
tests/hard_coded/dense_lookup_switch2.exp:
tests/hard_coded/dense_lookup_switch_non.exp:
tests/hard_coded/existential_float.exp:
tests/hard_coded/expand.exp:
tests/hard_coded/final_excp.exp:
tests/hard_coded/float_field.exp:
tests/hard_coded/float_gv.exp:
tests/hard_coded/float_reg.exp:
tests/hard_coded/float_rounding_bug.exp:
tests/hard_coded/init_excp.exp:
tests/hard_coded/mutable_excp.exp:
tests/hard_coded/pragma_import.exp:
tests/hard_coded/prince_frameopt.exp:
tests/hard_coded/string_string.exp:
tests/hard_coded/unused_float_box_test.exp:
tests/hard_coded/write.exp:
tests/hard_coded/write_binary.exp:
tests/hard_coded/write_reg1.exp:
tests/hard_coded/write_xml.exp:
tests/hard_coded/sub-modules/non_word_mutable.exp:
tests/hard_coded/typeclasses/arbitrary_constraint_class.exp:
tests/hard_coded/typeclasses/arbitrary_constraint_pred_1.exp:
tests/hard_coded/typeclasses/arbitrary_constraint_pred_2.exp:
tests/hard_coded/typeclasses/existential_rtti.exp:
tests/hard_coded/typeclasses/func_default_mode_bug.exp:
tests/hard_coded/typeclasses/mode_decl_order_bug.exp:
tests/hard_coded/typeclasses/module_test.exp:
tests/hard_coded/typeclasses/typeclass_exist_method.exp:
tests/invalid/error_in_list.err_exp:
tests/invalid/errors2.err_exp:
tests/invalid/purity/purity_type_error.err_exp:
tests/mmc_make/complex_test.exp:
tests/recompilation/add_type_re.exp.1:
tests/recompilation/type_spec_rename_var_r.exp.1:
tests/recompilation/type_spec_rename_var_r.exp.2:
tests/recompilation/type_spec_unname_var_r.exp.1:
tests/recompilation/type_spec_unname_var_r.exp.2:
	Updated expected test case output.
2007-02-15 00:41:59 +00:00

55 lines
1.2 KiB
Plaintext

tests of (complex op complex)
X = cmplx(3.0, 4.0)
X + X = cmplx(6.0, 8.0)
X - X = cmplx(0.0, 0.0)
X * X = cmplx(-7.0, 24.0)
X / X = cmplx(1.0, 0.0)
Y = cmplx(-5.0, 6.0)
Y + Y = cmplx(-10.0, 12.0)
Y - Y = cmplx(0.0, 0.0)
Y * Y = cmplx(-11.0, -60.0)
Y / Y = cmplx(1.0, 0.0)
X + Y = cmplx(-2.0, 10.0)
X - Y = cmplx(8.0, -2.0)
X * Y = cmplx(-39.0, -2.0)
X / Y = cmplx(0.14754098360655737, -0.6229508196721312)
tests of (imag op imag)
Z = im(4.0)
Z + Z = im(8.0)
Z - Z = im(0.0)
Z * Z = -16.0
Z / Z = 1.0
tests of (float op imag)
5.0 + Z = cmplx(5.0, 4.0)
5.0 - Z = cmplx(5.0, -4.0)
5.0 * Z = im(20.0)
5.0 / Z = im(-1.25)
tests of (imag op float)
Z + 5.0 = cmplx(5.0, 4.0)
Z - 5.0 = cmplx(-5.0, 4.0)
Z * 5.0 = im(20.0)
Z / 5.0 = im(0.8)
tests of (complex op imag)
X + Z = cmplx(3.0, 8.0)
X - Z = cmplx(3.0, 0.0)
X * Z = cmplx(-16.0, 12.0)
X / Z = cmplx(1.0, -0.75)
Y + Z = cmplx(-5.0, 10.0)
Y - Z = cmplx(-5.0, 2.0)
Y * Z = cmplx(-24.0, -20.0)
Y / Z = cmplx(1.5, 1.25)
tests of (imag op complex)
Z + X = cmplx(3.0, 8.0)
Z - X = cmplx(-3.0, 0.0)
Z * X = cmplx(-16.0, 12.0)
Z / X = cmplx(0.64, 0.48)
Z + Y = cmplx(-5.0, 10.0)
Z - Y = cmplx(5.0, -2.0)
Z * Y = cmplx(-24.0, -20.0)
Z / Y = cmplx(0.39344262295081966, -0.32786885245901637)