C floating point

D

Dik T. Winter

....
> You miss the point. sizeof creates something of type size_t.
> This may be significantly larger than an int, so lying to the
> compiler about the parameter supplied to a variadic function
> results in UB.

You are missing the cast.
 
D

Dan Pop

In said:
Your best bet for now is to do arithmetic using integers to count
pennies.

Your best bet for now is to use a scaling factor (so that you deal with
integer values) and use long double's (in C89) or long long's (in C99) for
storing and manipulating these integer values.

Dan
 
E

E. Robert Tisdale

P.J. Plauger said:
Fixed-point arithmetic, with a fractional part,
is not a part of Standard C. However, TR 18037

Can I get any documentation on this?
And, if so, where?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top