mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 19:33:46 +00:00
Estimated hours taken: 0.25 Add a regression test for a bug which caused the compiler to generate code that used integer division in `io__write_string(1.0/2.0)'.
19 lines
435 B
Mathematica
19 lines
435 B
Mathematica
% This is a regression test; Mercury 0.5 and earlier had
|
|
% a bug in which floating point division expressions involving
|
|
% whole numbers were computed using integer division rather
|
|
% than floating point division.
|
|
|
|
:- module float_rounding_bug.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io__state::di, io__state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
:- import_module float.
|
|
|
|
main --> io__write_float(1.0/2.0), io__write_char('\n').
|