From 35c60cf4644dfe826687494824ee7a44660e416f Mon Sep 17 00:00:00 2001 From: Larpon Date: Tue, 23 Mar 2021 10:01:24 +0100 Subject: [PATCH] =?UTF-8?q?doc:=20reflect=20current=20`int`=20=E2=86=92=20?= =?UTF-8?q?`f32`=20behaviour=20(#9433)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/docs.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index b4cd19b832..fbcce791a5 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -434,9 +434,10 @@ These are the allowed possibilities: i8 → i16 → int → i64 ⬏ ``` An `int` value for example can be automatically promoted to `f64` -or `i64` but not to `f32` or `u32`. (`f32` would mean precision -loss for large values and `u32` would mean loss of the sign for +or `i64` but not to `u32`. (`u32` would mean loss of the sign for negative values). +Promotion from `int` to `f32`, however, is currently done automatically +(but can lead to precision loss for large values). Literals like `123` or `4.56` are treated in a special way. They do not lead to type promotions, however they default to `int` and `f64`