[Cfp-interest] C operators

Mike Cowlishaw mfc at speleotrove.com
Mon Mar 18 06:26:23 PDT 2013


Just got the attached request from someone implementing a decimal arithmetic
library; I think it's a C/C++ question really.  But I'm not sure where to 'point
him to'.  Any suggestions appreciated.
 
Mike
 
The C++ decimal FP TR defines, well, everything, in terms of IEEE-754.
 Also operations like this: lhs == rhs where lhs or rhs are integers or binary
FP types.  I am trying to interpret IEEE-754 to see if it indeed defines such
operations.  (With a quick look I could not find.)
 
I have no problem defining the return value, however I am not sure if and what
exceptions are to be raised?  For example, if I compare a
decimal32 to a double, and the double is larger that dec32_max, should I set
overflow?  (Because I have tried to convert the double to
dec32.)  Or perhaps I should set inexact, because I have tried to convert the
Dec32 to double first, and it may not be exactly representable?
 
Could you give me a hint on what sections of the IEEE-754 I should read to find
out those things?  Thanks in advance.  Oh, and feel free to tell me if I ask too
much.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20130318/d3d81bb3/attachment.html 


More information about the Cfp-interest mailing list