Új hozzászólás Aktív témák
-
válasz
mylastage
#2924
üzenetére
Pascalban az int változó sose vett fel tört értéket. Szerintem az emlékeid ködösítik a múltat. Persze ettől függetlenül a Real így működött, de az már a régmúlt.
Ráadásul ez nem egy python 'tulajdonság' igazából, az utóbbi időben (nem 25 évvel ezelőtt) már ez (banker's round) a sztenderd, azaz a felet mindig a közelebbi páros számhoz kell kerekíteni. Ez egy komolyabb (statisztikai) problémát old meg, mivel a 0.5 mindig felfelé kerekítése mérhető mértékben eltolja a kerekített számok eloszlását.
What’s New In Python 3.0:
The round() function rounding strategy and return type have changed. Exact halfway cases are now rounded to the nearest even result instead of away from zero. (For example, round(2.5) now returns 2 rather than 3.)
For the built-in types supporting round(), values are rounded to the closest multiple of 10 to the power minus n; if two multiples are equally close, rounding is done toward the even choice.
+
Python 3's way (called "round half to even" or "banker's rounding") is considered the standard rounding method these days, though some language implementations aren't on the bus yet.
The simple "always round 0.5 up" technique results in a slight bias toward the higher number. With large numbers of calculations, this can be significant. The Python 3.0 approach eliminates this issue.
Új hozzászólás Aktív témák
- PlayStation 5
- A fociról könnyedén, egy baráti társaságban
- Gitáros topic
- Kókuszdió: Tápegység – hova jutottunk 5 év alatt?
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Borderlands 4
- Bestbuy játékok
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Apple iPhone 17 Pro Max – fennsík
- Battlefield 6
- További aktív témák...
- 365 NAPRA RÉSZLETRE BANKMNETES KAMATMENTES , GAMER PC ,LAPTOPOK , GAMER SZÉKEK , GAMER MONITOROK
- LG 34WQ75X-B - 34" Ívelt IPS Panel - 3440x1440 2K QHD - 60Hz 5ms - FreeSync - USB Type-C 90W
- Ventilátorok 120/140mm és tápkábel modding kitűnő árakon!
- Gamer PC-Számítógép! Csere-Beszámítás! R7 7800X3D / 32GB DDR5 / RX 9070 / 2TB SSD!
- HIBÁTLAN iPhone 12 256GB Blue-1 ÉV GARANCIA - Kártyafüggetlen, MS4462
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs

