首页 > 代码库 > ios开发之-计算器的改进

ios开发之-计算器的改进

#import <Foundation/Foundation.h>

extern double add(double x,double y);

extern double subtract(double x,double y);

extern double multiply(double x,double y);

extern double divide(double x,double y);
#import <Foundation/Foundation.h>
#import "MathOperation.h"

BOOL isAnOperator(const char value)
{
    return ((value =http://www.mamicode.com/= ‘+‘)||(value == ‘-‘)||(value ==‘*‘)||(value == ‘/‘));"%.3f",result);
    
}
//@implementation Calculator
//
//@end

#include "MathOperation.h"

double add(double x,double y)
{
    return x + y;
}

double subtract(double x,double y)
{
    return x - y;
}

double multiply(double x,double y)
{
    return  x * y;
}

double divide(double x,double y)
{
    return x / y;
}


ios开发之-计算器的改进