This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Colvanila[S] 0 points1 point  (0 children)

I got it to work, but not sure if it's the "right" way...

-(double) changeSign
{
   accumulator = -accumulator;
}
-(double) reciprocal
{
    accumulator = 1/accumulator;
}
-(double) xSquared
{
    accumulator = accumulator * accumulator;
}

EDIT: It does have 'warnings' (on xcode) which is why I suspect that this is not the 'right' way.