Results 1 to 15 of 15

Thread:

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Deleted User 4eRNoBiL's Avatar
    Join Date: Oct:2005
    Location:
    Posts: 739

    . , :
    Code:
    ...
    double a=1.51,b[9],i;
    
    for (i=0.0;i<9.0;i++) b[i]=a*i;
    ...
    . 1.51*5.0 7.54999999... , , ?

    , .
    Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19

  2. #2
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    double

    , . , .

  3. #3
    Registered User
    Join Date: Mar:2004
    Location:
    Posts: 3,748
    Quote Originally Posted by 4eRNoBiL View Post
    . 1.51*5.0 7.54999999... , , ?
    : 5-6, - "" . "" , , - ...

    ( , ), (, ), ...

    , : .

    ( , 3-4 )

  4. #4
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    ,
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  5. #5
    Deleted User 4eRNoBiL's Avatar
    Join Date: Oct:2005
    Location:
    Posts: 739
    , - , . , 4 - . , .

    , .

    ! !
    Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19

  6. #6
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    - ? double, - . 99% , - .

  7. #7
    Deleted User 4eRNoBiL's Avatar
    Join Date: Oct:2005
    Location:
    Posts: 739
    , . , , , , ... , , .

    , , , .
    Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19

  8. #8
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by 4eRNoBiL View Post
    , .

    , . ?

    16- . printf("%.10lf", ...) printf("%.20lf", ...).
    Last edited by Pesho; 19th March 2007 at 17:18.

  9. #9
    ɐ-əpoɔᴉu⋂ ɐ ə anrieff's Avatar
    Join Date: Apr:2004
    Location: Sofia
    Posts: 8,448
    Quote Originally Posted by 4eRNoBiL View Post
    , .
    , , "" ", " .

    - - 2^-50 ( ).

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

  10. #10
    kernel panic,me- no panic the_real_maniac's Avatar
    Join Date: May:2003
    Location: Europe, BG
    Posts: 1,141
    , , , .

    Win dev-cpp .



    Code:
    #include <stdio.h>
    #include <conio.h>
    
    int main(void)
    {
    	
    	double a,b,c;
    	
    	a = 1.51;
    	b = 5.0;
    	
    	c = a * b;
    	
    	printf("%lf * %lf = %lf\n", a, b, c);
    	
    	getch();
    	
    	return 0;
    	
    }
    1.510000 * 5.000000 = 7.550000

    ---


    Code:
    double a=1.51,b[9],i;
    
    for (i=0.0;i<9.0;i++) b[i]=a*i;

    17 *** array subscript is not an integer

    i int.



    0.000000
    1.510000
    3.020000
    4.530000
    6.040000
    7.550000
    9.060000
    10.570000
    12.080000

    .
    Running Linux from 2001

  11. #11
    Pesho's Avatar
    Join Date: Nov:2001
    Location: Sofia
    Posts: 5,169
    Quote Originally Posted by the_real_maniac View Post
    1.510000 * 5.000000 = 7.550000

    , 6 . "%.20lf" .

  12. #12
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    - GCC, , , ...
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  13. #13
    philosophus duratea icaci's Avatar
    Join Date: Oct:2006
    Location: Aachen
    Posts: 2,698
    1.51000000000000000888 * 5.00000000000000000000 = 7.54999999999999982236
    Internet - it doesn't make you stupid, it just makes your stupidity more accessible to others

  14. #14
    no brain no pain baracuda's Avatar
    Join Date: Aug:2006
    Location: Sofia
    Posts: 35,840
    4eRNoBi, . .
    P.S. " " . truncate- double- int . 3.9999999999999, 4, 3. , .
    Last edited by baracuda; 21st March 2007 at 01:47.

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 |