Results 1 to 9 of 9

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Aug:2007
    Location:
    Posts: 1,335

    Question 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.

  2. #2
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    C++ ( C) , strict aliasing rules. , :

    1. float
    2.
    3. float

    " ", float- . - , .

    , PEEK/POKE , .

    : union-. . :

    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]));
    (fp.c[1] = 0x23) POKE.

    !
    , . .
    "640K ught to be enough for anybody" - Bill Gates, 1981
    ::Machine specs::Fract::AGG::::Baileys::blog::YouTube channel

  3. #3
    Registered User 4004's Avatar
    Join Date: Apr:2011
    Location: BG
    Posts: 2,061
    dos.h? , . , , 10 . 20 .

    float double . , ? .
    Last edited by 4004; 18th June 2020 at 11:04.

  4. #4
    Registered User
    Join Date: Dec:2007
    Location:
    Posts: 655
    Quote Originally Posted by anrieff View Post
    C++ ( C) , strict aliasing rules.
    C strict aliasing, , - ( "char") , , , C. "restrict", .

  5. #5
    Registered User RFK's Avatar
    Join Date: Jul:2011
    Location: BG
    Posts: 1,629
    , . .

  6. #6
    Banned
    Join Date: Apr:2018
    Location: .
    Posts: 2,742
    Quote Originally Posted by PET3 View Post
    , . , ASCII , BCD .
    ? " "?

  7. #7
    Registered User 4004's Avatar
    Join Date: Apr:2011
    Location: BG
    Posts: 2,061
    , - . , . , ASCII, BCD, EBCDIC .
    Last edited by 4004; 18th June 2020 at 13:32.

  8. #8
    Registered User
    Join Date: Aug:2007
    Location:
    Posts: 1,335
    anrieff.

  9. #9
    Registered User 4004's Avatar
    Join Date: Apr:2011
    Location: BG
    Posts: 2,061
    - ? , , .

    Quote Originally Posted by anrieff View Post
    " ", float- . - , .
    , . " ", . volatile. , - , double. float/double - . , , .
    Last edited by 4004; 19th June 2020 at 12:22.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |