Thread: Hi

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Smile Hi


    im new to Programming python, i've started using the unit test function, and im about to assert a float.

    i know how to use the first one:

    self.assertEqual(first, second, msg)

    but i need this one:

    self.assertAlmostEqual(first, second, places, msg, delta)

    and here is my question, as gar as i know delta is the precision i want, but what is places?
  2. #2
  3. No Profile Picture
    Super Moderator
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jul 2003
    Posts
    4,008
    Rep Power
    2790
    Welcome to DevShed, kosten.

    The 'places' argument is the number of decimal places you wish to compare.
    [PHP] | [Perl] | [Python] | [Java] != [JavaScript] | [XML] | [ANSI C] | [C++] | [LUA] | [MySQL] | [FirebirdSQL] | [PostgreSQL] | [HTML] | [XHTML] | [CSS]

    W3Fools - A W3Schools Intervention.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0
    Originally Posted by Winters
    Welcome to DevShed, kosten.

    The 'places' argument is the number of decimal places you wish to compare.
    thank you so very much

IMN logo majestic logo threadwatch logo seochat tools logo