Ticket #7356: latex-float-4.2.1.patch

File latex-float-4.2.1.patch, 1.2 KB (added by robertwb, 12 years ago)

Use instead of other, applies on top of #7328

  • sage/misc/latex.py

    # HG changeset patch
    # User Robert Bradshaw <robertwb@math.washington.edu>
    # Date 1258694944 28800
    # Node ID 17b29c159d411352f74be0c3e87c551c26a372f1
    # Parent  893f9502fe2027ea17325040bdabd05593432bfb
    Make latex(float(x)) more like RDF rather than RR.
    
    diff -r 893f9502fe20 -r 17b29c159d41 sage/misc/latex.py
    a b  
    270270   
    271271        sage: from sage.misc.latex import float_function
    272272        sage: float_function(float(3.14))
    273         3.14000000000000
     273        3.14
    274274        sage: float_function(float(1e-10))
    275         1.00000000000000 \times 10^{-10}
     275        1 \times 10^{-10}
    276276        sage: float_function(float(2e10))
    277         2.00000000000000 \times 10^{10}
     277        20000000000.0
    278278        sage: latex(float(2e-13))
    279279        2.00000000000000 \times 10^{-13}
    280280    """
    281     from sage.all import RR
    282     return latex(RR(x))
     281    from sage.all import RDF
     282    return latex(RDF(x))
    283283
    284284latex_table = {list: list_function, tuple:tuple_function, bool:bool_function,
    285285               str: str_function, int:str, long:str, float:float_function, dict: dict_function}