Ticket #7852: trac_7852-fix_noise_errors_in_preparser_examples.reviewer.patch

File trac_7852-fix_noise_errors_in_preparser_examples.reviewer.patch, 1.1 KB (added by leif, 10 years ago)

Reviewer patch. Apply on top of main patch, which causes a signed zero on Itanium 2.

  • sage/misc/preparser.py

    # HG changeset patch
    # User Leif Leonhardy <not.really@online.de>
    # Date 1316999764 14400
    # Node ID c7c3a462f156df79f0e73fc9cb24b92537759e72
    # Parent  6f081ebdc3d4554875fc0b58044312aac99cf8dc
    #7852 Reviewer patch: Fix doctest errors due to noisy (signed) zero vector component in preparser examples (seen on Linux IA64 / Itanium 2).
    
    diff --git a/sage/misc/preparser.py b/sage/misc/preparser.py
    a b  
    13831383
    13841384            sage: A = matrix(RDF, 5, 5, 2)
    13851385            sage: b = vector(RDF, 5, range(5))
    1386             sage: A \ b
     1386            sage: # On at least one platform, we get a "negative zero":
     1387            sage: v = A \ b
     1388            sage: v.zero_at(1e-19)
    13871389            (0.0, 0.5, 1.0, 1.5, 2.0)
    1388             sage: A._backslash_(b)
     1390            sage: v = A._backslash_(b)
     1391            sage: v.zero_at(1e-19)
    13891392            (0.0, 0.5, 1.0, 1.5, 2.0)
    1390             sage: A * BackslashOperator() * b
     1393            sage: v = A * BackslashOperator() * b
     1394            sage: v.zero_at(1e-19)
    13911395            (0.0, 0.5, 1.0, 1.5, 2.0)
    13921396        """
    13931397        return self.left._backslash_(right)