Results 1 to 6 of 6

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Banned
    Join Date: Oct:2003
    Location:
    Posts: 5,259

    .
    :

    echo (int) ((0.4+0.4) * 10 );
    8

    :
    echo (int) ((0.1+0.7) * 10 );
    7

    echo (float) ((0.7+0.1) * 10 );
    8!

    .1+.7 .8
    7 7.9999, (int) 7. cast- , PHP ?
    , !

    !

  2. #2
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331

  3. #3
    Banned
    Join Date: Oct:2003
    Location:
    Posts: 5,259
    " " ???

    0.4 , 0.1, 0.7, 6.00. ?

    ..
    , , , .
    Last edited by Softman; 30th August 2010 at 19:40.

  4. #4
    Registered User
    Join Date: Aug:2006
    Location:
    Posts: 4,052

  5. #5
    Banned
    Join Date: Oct:2003
    Location:
    Posts: 5,259
    Quote Originally Posted by solar_sea View Post
    .

  6. #6
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    -, :
    PHP Code:
    <?
    printf
    ("%.25f != %.25f\n"0.1+0.70.8);
    printf("%.25f == %.25f\n"0.4+0.40.8);
    printf("0.1 != %.25f\n"0.1);
    printf("0.7 != %.25f\n"0.7);
    printf("0.4 != %.25f\n"0.4);
    printf("0.8 != %.25f\n"0.8);
    ?>
    0.7999999999999999333866185 != 0.8000000000000000444089210
    0.8000000000000000444089210 == 0.8000000000000000444089210
    0.1 != 0.1000000000000000055511151
    0.7 != 0.6999999999999999555910790
    0.4 != 0.4000000000000000222044605
    0.8 != 0.8000000000000000444089210
    .
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

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 |