Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cos is defined for float only. So you can use the following code.

from sage.all import *

class MyAngle(object):
    def __init__(self,value):
        self.value=value
    def cos(self):
        return(n(cos(self.value)))
x=MyAngle(4/2)
cos(x)