Reputation: 5897
Moving a discussion on relative merits of integers and floats into a separate question. Here it is: what is your preference between an integer type or a floating point type in situations that are neither inherently integral nor inherently floating point? For example, when developing geometric engine for a well-conntrolled range of scales would you prefer integer coordinates in the smallest feasible units or float/double coordinates?
Upvotes: 0
Views: 198
Reputation: 222362
Some reasons to prefer floating-point are:
Some reasons to prefer integers are:
I considered ways to list certain “features” of integer arithmetic as reasons to use it, but, upon examination, they are not actual features:
Upvotes: 2
Reputation: 672
Here are some ideas to when NOT to use floats/doubles and stick to integers/fixedpoint
Upvotes: -1