CoCalc Shared Filessupport / 2015-02-24-094434 pi in RIF.sagews
Authors: Harald Schilly, ℏal Snyder, William A. Stein
Description: Examples for support purposes.
version()

'Sage Version 6.5, Release Date: 2015-02-17'
pi in RR

True
RR(pi) == pi

3.14159265358979 == pi
bool(RR(pi) == pi)

True
pi in RIF

False
RIF(pi)

3.141592653589794?
bool(RIF(pi) == pi)

Error in lines 1-1 Traceback (most recent call last): File "/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/.sagemathcloud/sage_server.py", line 873, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/symbolic/expression.pyx", line 2220, in sage.symbolic.expression.Expression.__nonzero__ (build/cythonized/sage/symbolic/expression.cpp:14082) return test_relation_maxima(self) File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/relation.py", line 451, in test_relation_maxima m = relation._maxima_() File "sage/symbolic/expression.pyx", line 584, in sage.symbolic.expression.Expression._maxima_ (build/cythonized/sage/symbolic/expression.cpp:5512) return super(Expression, self)._interface_(maxima) File "sage/structure/sage_object.pyx", line 587, in sage.structure.sage_object.SageObject._interface_ (build/cythonized/sage/structure/sage_object.c:5054) s = init_func() File "sage/structure/sage_object.pyx", line 694, in sage.structure.sage_object.SageObject._maxima_lib_init_ (build/cythonized/sage/structure/sage_object.c:7902) return self._maxima_init_() File "sage/structure/sage_object.pyx", line 687, in sage.structure.sage_object.SageObject._maxima_init_ (build/cythonized/sage/structure/sage_object.c:7640) return self._interface_init_(I) File "sage/symbolic/expression.pyx", line 621, in sage.symbolic.expression.Expression._interface_init_ (build/cythonized/sage/symbolic/expression.cpp:5710) return InterfaceInit(I)(self) File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 217, in __call__ return self.relation(ex, operator) File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 468, in relation return "%s %s %s"%(self(ex.lhs()), self.relation_symbols[operator], File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 205, in __call__ raise err TypeError
bool(SR(RIF(pi)) == pi)

Error in lines 1-1 Traceback (most recent call last): File "/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/.sagemathcloud/sage_server.py", line 873, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/symbolic/expression.pyx", line 2220, in sage.symbolic.expression.Expression.__nonzero__ (build/cythonized/sage/symbolic/expression.cpp:14082) return test_relation_maxima(self) File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/relation.py", line 451, in test_relation_maxima m = relation._maxima_() File "sage/symbolic/expression.pyx", line 584, in sage.symbolic.expression.Expression._maxima_ (build/cythonized/sage/symbolic/expression.cpp:5512) return super(Expression, self)._interface_(maxima) File "sage/structure/sage_object.pyx", line 587, in sage.structure.sage_object.SageObject._interface_ (build/cythonized/sage/structure/sage_object.c:5054) s = init_func() File "sage/structure/sage_object.pyx", line 694, in sage.structure.sage_object.SageObject._maxima_lib_init_ (build/cythonized/sage/structure/sage_object.c:7902) return self._maxima_init_() File "sage/structure/sage_object.pyx", line 687, in sage.structure.sage_object.SageObject._maxima_init_ (build/cythonized/sage/structure/sage_object.c:7640) return self._interface_init_(I) File "sage/symbolic/expression.pyx", line 621, in sage.symbolic.expression.Expression._interface_init_ (build/cythonized/sage/symbolic/expression.cpp:5710) return InterfaceInit(I)(self) File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 217, in __call__ return self.relation(ex, operator) File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 468, in relation return "%s %s %s"%(self(ex.lhs()), self.relation_symbols[operator], File "/usr/local/sage/sage-6.5/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 205, in __call__ raise err TypeError

RIF(3) == 3

True
RIF(pi) == RR(pi)

False
RIF(pi) == RealField(300)(pi)

False