First time here? Check out the FAQ!
answered 14 years ago
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)