An hour later, trying to find an error in my code, I finally found the reason. I tried to add a very small float in 1f, but nothing happened. When trying to figure out why I found that adding a small float to 0f works fine.
Why is this happening? Is this related to "order of magnitude"? Is there any workaround?
Thanks in advance.
Edit:
Switching to double precision or decimal is not currently an option.
(32 ) 7 . , , , , , 1. , . 1, ... .
1
double, . , , .
double
EDIT:. , double , Kahan, akuhn .
, float . , , , .
float
, , , , , , .
, , 0, , 0, .
.
, - . , , decimal. .
decimal
float . , 1f. , double
http://msdn.microsoft.com/en-us/library/ayazw934.aspx
: , Kahan Summation.
( double), / . float , (, 2 ^ 16). . , .
, .
f , . , .
Source: https://habr.com/ru/post/1705566/More articles:Where can I find a good VCS written in PHP? - version-controlInformix Upgrade - Migrating to Oracle, Sybase, or Staying with Informix? - oraclehow to quickly verify that a case-sensitive file name really exists - delphiWPF 3D - Why is my ImageBrush not showing? - wpfhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1705565/using-firefox-only-css-to-round-corners-of-elements&usg=ALkJrhh1rn5Y0abLxrMfyxvWtpPEkq7iGwIs the variable "by reference" changed? - javascriptConditional fork in SQL based on variable type - sqlWhat is the average divs limit for a page to be stable? - htmlWhat is the best way to efficiently extract a small random subset of a large enumerable? - sortingБлокировка файла при записи на диск - javaAll Articles