[omniORB] native python fixed point in omniORBpy

Duncan Grisby duncan at grisby.org
Mon Jan 8 14:51:25 GMT 2007


On Thursday 14 December, "Luke Deller" wrote:

> Are there any plans to deprecate omnipyFixed in favour of
> decimal.Decimal (which has been in the standard library since Python 2.4
> released in 2004)?

I don't have any plans to do it, but if somebody submitted a patch, that
might encourage the plans... ;-)

> I realise that such a change would deviate from the Python language
> mapping.  It seems to me though that the Python language mapping is so
> far out of date that it no longer conforms to the CORBA requirements for
> language mappings: 
> the CORBA 2.6 spec says in 3.10.3.4: "the fixed data type will be mapped
> to the native fixed point capability of a programming language, if
> available".

I think it could be done in a way that's compatible with the CORBA
mapping. I haven't looked into the details, though.

> Strictly speaking decimal.Decimal is a floating-point type rather than a
> fixed-point type because the scale can be modified by arithmetic
> operations.  This is also true for omnipyFixed.  I suspect that this
> does match what the CORBA specification intended for the "fixed-point"
> type though, because this floating-point behaviour for arithmetic is
> explicitly defined for evaluation of IDL constant expressions in section
> 3.9.2 of the CORBA 2.6 spec.

As we've talked about already, CORBA.fixed is a floating-point type, so
decimal.Decimal is the right kind of beast.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list