0

My C++ is a bit rusty, and I'm used to C# which has a nice "Decimal" datatype which is a floating "decimal" point number, which is great for very accurate stuff or where rounding errors would be bad (and I don't care about speed)

I just can't seem to declare something to be a decimal128.

  • Looking for help on how to declare a decimal variable.
  • The proper suffix for printf would be great too.
πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
  • If you are really dealing with money and you do not need fractions of a cent then you can use to integers, one representing dollars and the other cents. – NathanOliver Oct 06 '16 at 15:14
  • Xcode is an IDE and has nothing to do with your question. Please tag properly. – rmaddy Oct 06 '16 at 15:21
  • If you are dealing with money, use an (single) integer to represent the lowest common form, such as cents in US currency. No need to have one integer for dollars and one for cents. You can calculate dollars by dividing by 100. – Thomas Matthews Oct 06 '16 at 15:25

0 Answers0