Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Floor - floor(16.9 * 100) = 1689 ?
duch4ever
post 24.10.2016, 21:27:52
Post #1





Grupa: Zarejestrowani
Postów: 155
Pomógł: 0
Dołączył: 22.06.2010

Ostrzeżenie: (0%)
-----


Jak w temacie: http://sandbox.onlinephpfunctions.com/code...7e5d74db5e26f24
Wytłumaczy ktoś?
Go to the top of the page
+Quote Post
Spawnm
post 24.10.2016, 22:51:46
Post #2





Grupa: Moderatorzy
Postów: 4 069
Pomógł: 497
Dołączył: 11.05.2007
Skąd: Warszawa




http://php.net/manual/en/language.types.fl...float-precision
Go to the top of the page
+Quote Post
duch4ever
post 25.10.2016, 11:59:57
Post #3





Grupa: Zarejestrowani
Postów: 155
Pomógł: 0
Dołączył: 22.06.2010

Ostrzeżenie: (0%)
-----


Cytat
This can lead to confusing results: for example, floor((0.1+0.7)*10) will usually return 7 instead of the expected 8, since the internal representation will be something like 7.9999999999999991118....

Dzięki, temat do zamknięcia.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 25.04.2024 - 22:13