In this paper, a new immune algorithm is presented to solve the numerical function optimization problem. Unlike the commonly used immune algorithm which is based on manipulations of binary strings, the proposed one is to directly utilize a real-coded manipulation. For dealing with most of physical engineering problem, for example, function optimization, this kind of immune algorithm is very applicable. The definition for similarity and mutation mechanism used in the artificial immune algorithm need to be modified renewedly in order to suit with real-coded manipulations. Simulation results reveal that the proposed algorithm can successfully solve the function optimization problems.