1.å
³äºc#ä¸ floatç±»åçåå¼èå´
å ³äºc#ä¸ floatç±»åçåå¼èå´
floatçåå¼èå´floatå ç¨4个åè,源码触发流程源码åintæ¯ä¸æ ·,ä¹å°±æ¯bit.
1bitï¼ç¬¦å·ä½ï¼ 8bitsï¼ææ°ä½ï¼ bitsï¼å°¾æ°ä½ï¼
åå¨æ¹å¼å¦ä¸å¾ï¼
åå¼èå´åºæ¬è¡¨è¾¾æ³ï¼
ï¼æµ®ç¹ï¼æ°å¼ = å°¾æ° Ã åºæ° ^ ææ°ï¼ï¼éå æ£è´å·ï¼----------------
äºæ¯ï¼floatçææ°èå´ä¸º-~ï¼èdoubleçææ°èå´ä¸º-~ï¼å¹¶ä¸ææ°ä½æ¯æè¡¥ç çå½¢å¼æ¥ååçãå ¶ä¸è´ææ°å³å®äºæµ®ç¹æ°æè½è¡¨è¾¾çç»å¯¹å¼æå°çæ°ï¼èæ£ææ°å³å®äºæµ®ç¹æ°æè½è¡¨è¾¾çç»å¯¹å¼æ大çæ°ï¼ä¹å³å³å®äºæµ®ç¹æ°çåå¼èå´ã
floatçèå´ä¸º-2^ ~ +2^ï¼ä¹å³-3.E+ ~ +3.E+ï¼doubleçèå´ä¸º-2^ ~ +2^ï¼ä¹å³-1.E+ ~ +1.E+ã
å ¶ä»ç¹æ®è¡¨ç¤ºï¼
1.å½ææ°é¨ååå°æ°é¨åå ¨ä¸º0æ¶,表示0å¼,æ+0å-0ä¹å(符å·ä½å³å®)ï¼0x表示æ£0ï¼0x表示è´0ã
2.ææ°é¨åå ¨1ï¼å°æ°é¨åå ¨0æ¶ï¼è¡¨ç¤ºæ 穷大ï¼ææ£æ ç©·åè´æ ç©·ï¼0x7f表示æ£æ ç©·ï¼0xff表示è´æ ç©·ã
3.ææ°é¨åå ¨1ï¼å°æ°é¨åä¸å ¨0æ¶ï¼è¡¨ç¤ºNaNï¼å为QNaNåSNaNï¼Javaä¸é½æ¯NaNã
2024-12-27 14:54
2024-12-27 14:44
2024-12-27 14:35
2024-12-27 14:18
2024-12-27 13:59
2024-12-27 13:26
2024-12-27 13:20
2024-12-27 12:27