Results 1 to 7 of 7
Thread: -
Hybrid View
-
1st May 2007 20:44 #1
-
-1,4*10^-45 32 IEEE 754 ?
, , . !
-
1st May 2007 20:49 #2Registered User
Join Date: Oct:2003
Location:
Posts: 4,317
, .
, " ".
, , , Google "c float range" ( ), :
http://en.wikipedia.org/wiki/IEEE_754 ( )
http://en.wikipedia.org/wiki/Floating_point ( ).
-
1st May 2007 20:56 #3
-
2nd May 2007 09:52 #4
-
3rd May 2007 05:53 #5
-
3rd May 2007 15:22 #6
IEEE 754, C:
, 1 ( ), 8 ( ) 23 () :Code:int i; unsigned char c[sizeof(float)]; *(float *)c = -1.4e-45; // (float)M_PI printf("0x"); for (i = sizeof(float)-1; i >= 0; i--) printf("%02X", c[i]); printf("\n");
-1.4e-45: 0x80000001 = 1 00000000 00000000000000000000001
: 0x40490FDB = 0 10000000 10010010000111111011011
, . , 2 - , . = 3.141592653589... : 3 = 2 + 1 = 11(2). :
2*0.14159265358979311 = 0 + 0.28318530717958623
2*0.28318530717958623 = 0 + 0.56637061435917246
2*0.56637061435917246 = 1 + 0.13274122871834492
2*0.13274122871834492 = 0 + 0.26548245743668985
2*0.26548245743668985 = 0 + 0.53096491487337971
2*0.53096491487337971 = 1 + 0.06192982974675942
2*0.06192982974675942 = 0 + 0.12385965949351884
2*0.12385965949351884 = 0 + 0.24771931898703769
2*0.24771931898703769 = 0 + 0.49543863797407539
2*0.49543863797407539 = 0 + 0.99087727594815078
2*0.99087727594815078 = 1 + 0.98175455189630156
2*0.98175455189630156 = 1 + 0.96350910379260312
2*0.96350910379260312 = 1 + 0.92701820758520625
2*0.92701820758520625 = 1 + 0.85403641517041251
2*0.85403641517041251 = 1 + 0.70807283034082502
2*0.70807283034082502 = 1 + 0.41614566068165004
2*0.41614566068165004 = 0 + 0.83229132136330008
2*0.83229132136330008 = 1 + 0.66458264272660017
2*0.66458264272660017 = 1 + 0.32916528545320034
2*0.32916528545320034 = 0 + 0.65833057090640068
2*0.65833057090640068 = 1 + 0.31666114181280136
2*0.31666114181280136 = 0 + 0.63332228362560272
2*0.63332228362560272 = 1 + 0.26664456725120544
...
T.e.
= 11.00100100001111110110101...(2)
, .. , - 2 - 1, . :
= 1.100100100001111110110101...(2) * 2^1
, [1,2) ( ), - 1, . 23 , :
0.100100100001111110110101...(2) ~= 0.10010010000111111011011(2)
2^1 , 1 127 ( 32- IEEE 754). , . :
1 + 127 = 128 = 10000000(2)
, - 0 ( , 1). :
: 0(2)
: 10000000(2)
: 10010010000111111011011(2)
:
pi = 01000000010010010000111111011011(2) = 40490FDB(16) - , C. !
Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others
-
3rd May 2007 16:43 #7
icaci,

"" FP ... , source code- Quake 2- "Carmack's inverse" ( )..., . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in