Where should I look at if I want to switch between float and double precision at compile time. Its like, if user wants everything in float instead of double precision how I can maintain this flexibility? In other words, how should I define a variable that could be either float or double precision conditionally?
Share
If it is OK to make the switch at compile time, a simple
typedefwould do:Use
user_data_tin your code, and setUSE_DOUBLESif you wantdoublesat compile time: