Results 1 to 9 of 9
Thread: PEEK POKE C/C++?
Hybrid View
-
18th June 2020 08:01 #1Registered User
Join Date: Aug:2007
Location:
Posts: 1,335
PEEK POKE C/C++?
{PEEK POKE} #include <dos.h> ?
++.
.
float double .
.
.
, . , ASCII , BCD .
:
Difference between Decimal, Float and Double
======================================== ====
Single -> 4B -> Float - 32 bit (7 digits)
Double -> 8B -> Double - 64 bit (15-16 digits)
Quadruple -> 16B -> Decimal - 128 bit (28-29 significant digits)
, . .
{PEEK/POKE} , , .
!
.
-------------------------
, .
!
, .Last edited by PET3; 18th June 2020 at 08:28.
-
18th June 2020 09:02 #2
C++ ( C) , strict aliasing rules. , :
1. float
2.
3. float
" ", float- . - , .
, PEEK/POKE , .
: union-. . :
(fp.c[1] = 0x23) POKE.Code:union FloatPeek { float x; char c[4]; }; FloatPeek fp; fp.x = M_PI; printf("Second byte of %f is %u\n", fp.x, unsigned(fp.c[1]));
!, . .
"640K ught to be enough for anybody" - Bill Gates, 1981
::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel
-
18th June 2020 11:01 #3
dos.h? , . , , 10 . 20 .
float double . , ? .Last edited by 4004; 18th June 2020 at 11:04.
-
19th June 2020 20:58 #4Registered User
Join Date: Dec:2007
Location:
Posts: 655
-
19th June 2020 23:39 #5
-
18th June 2020 12:35 #6
-
18th June 2020 13:29 #7
, - . , . , ASCII, BCD, EBCDIC .
Last edited by 4004; 18th June 2020 at 13:32.
-
19th June 2020 08:13 #8Registered User
Join Date: Aug:2007
Location:
Posts: 1,335
anrieff.
-
19th June 2020 11:15 #9




Reply With Quote

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