Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
2682-Move-misplaced-comment.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2682-Move-misplaced-comment.patch of Package erlang
From 9b2a767b6181985ab4b6aa0ac039a7634c97154f Mon Sep 17 00:00:00 2001 From: Kjell Winblad <kjellwinblad@gmail.com> Date: Tue, 9 Mar 2021 10:12:49 +0100 Subject: [PATCH] Move misplaced comment --- lib/stdlib/src/io_lib_format.erl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/stdlib/src/io_lib_format.erl b/lib/stdlib/src/io_lib_format.erl index 9fab476750..597ff4c2c5 100644 --- a/lib/stdlib/src/io_lib_format.erl +++ b/lib/stdlib/src/io_lib_format.erl @@ -765,18 +765,6 @@ insert_decimal(Place, S, Float) -> {S0, S1} = lists:split(L + Place, S), S0 ++ "." ++ S1; 2 - Place - L =< ExpCost -> - %% All integers in the range [-2^53, 2^53] can - %% be stored without loss of precision in an - %% IEEE 754 64-bit double but 2^53+1 cannot be - %% stored in an IEEE 754 64-bit double without - %% loss of precision (float((1 bsl 53)+1) =:= - %% float(1 bsl 53)). It thus makes sense to - %% show floats that are >= 2^53 or <= -2^53 in - %% scientific notation to indicate that the - %% number is so large that there could be loss - %% in precion when adding or subtracting 1. - %% - %% https://stackoverflow.com/questions/1848700/biggest-integer-that-can-be-stored-in-a-double?answertab=votes#tab-top "0." ++ lists:duplicate(-Place - L, $0) ++ S; true -> insert_exp(ExpL, S) @@ -784,6 +772,18 @@ insert_decimal(Place, S, Float) -> true -> Dot = if L =:= 1 -> 1; true -> 0 end, if + %% All integers in the range [-2^53, 2^53] can + %% be stored without loss of precision in an + %% IEEE 754 64-bit double but 2^53+1 cannot be + %% stored in an IEEE 754 64-bit double without + %% loss of precision (float((1 bsl 53)+1) =:= + %% float(1 bsl 53)). It thus makes sense to + %% show floats that are >= 2^53 or <= -2^53 in + %% scientific notation to indicate that the + %% number is so large that there could be loss + %% in precion when adding or subtracting 1. + %% + %% https://stackoverflow.com/questions/1848700/biggest-integer-that-can-be-stored-in-a-double?answertab=votes#tab-top ExpCost + Dot >= Place + 2 andalso abs(Float) < float(1 bsl 53) -> S ++ lists:duplicate(Place, $0) ++ ".0"; true -> -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor