Ticket #12950: trac_12950-further_doctests_for_numerics.patch

File trac_12950-further_doctests_for_numerics.patch, 1.2 KB (added by jpflori, 7 years ago)

Further doctests fixes.

  • sage/stats/basic_stats.py

    # HG changeset patch
    # User Jean-Pierre Flori <jean-pierre.flor@ssi.gouv.fr>
    # Date 1337842365 -7200
    # Node ID bbdfc051b2f41ada9074993d8b87e38c15a491bb
    # Parent  fcae84dec07798e0852c070abb51787d9640077b
    Trac #12950: further doctests fixes
    
    diff --git a/sage/stats/basic_stats.py b/sage/stats/basic_stats.py
    a b  
    165165        sage: std([])
    166166        NaN
    167167        sage: std([I, sqrt(2), 3/5])
    168         sqrt(1/450*(-5*sqrt(2) + 10*I - 3)^2 + 1/450*(-5*sqrt(2) - 5*I + 6)^2 + 1/450*(10*sqrt(2) - 5*I - 3)^2)
     168        sqrt(1/450*(-5*sqrt(2) - 5*I + 6)^2 + 1/450*(10*sqrt(2) - 5*I - 3)^2 + 1/450*(-5*sqrt(2) + 10*I - 3)^2)
    169169        sage: std([RIF(1.0103, 1.0103), RIF(2)])
    170170        0.6998235813403261?
    171171        sage: import numpy
     
    230230        sage: variance([])                     
    231231        NaN
    232232        sage: variance([I, sqrt(2), 3/5])       
    233         1/450*(-5*sqrt(2) + 10*I - 3)^2 + 1/450*(-5*sqrt(2) - 5*I + 6)^2 + 1/450*(10*sqrt(2) - 5*I - 3)^2
     233        1/450*(-5*sqrt(2) - 5*I + 6)^2 + 1/450*(10*sqrt(2) - 5*I - 3)^2 + 1/450*(-5*sqrt(2) + 10*I - 3)^2
    234234        sage: variance([RIF(1.0103, 1.0103), RIF(2)])
    235235        0.4897530450000000?
    236236        sage: import numpy