Twin Field Scaled Number

Imported from previous forum

[ original email was from Darshan Khedekar - darshan.khedekar.ext@deutsche-boerse.com ]
Hi

I have a problem with the Prices that I want to distribute through FAST.
I have a fixed number of decimal places for each instrument that I have already sent with the "SecurityStatus Message - MsgType = f (lowercase)"
Now I donot want to resend the exponent in every “MarketData Message MsgType = X or W” and want the already sent field to be applied at the client end.
Moreover I donot want to convert the Prices to Scaled numbers as I want to retain the precision and avoid conversion.
Is there a way I can specify this in FAST?

Thanks and Regards
Darshan Khedekar

Hi Darshan,

you can use a constant exponent if you have the same number
of decimals for all instruments that are rendered with a
specific template. For example:

The exponent will not occupy a pmap slot and the decimal
number is assumed to have two decimals.

You can use copy encoding for the exponent if you want
more flexibility in choice of decimals within a template:

In this case the exponent and mantissa will occupy one pmap
slot each, but the exponent will not be rendered on the wire
as long as you stick to the same exponent value.

(or just: )

I’m not sure I follow your line of thought regarding that
you want to avoid conversion in order to retain precision
as decimal numbers provide an exact representation. So,
you will be able to retain that precision, given that your
native representation is exact.

How do you represent prices internally?

Best,
Rolf

Hi

I have a problem with the Prices that I want to distribute
through FAST. I have a fixed number of decimal places for
each instrument that I have already sent with the
“SecurityStatus Message - MsgType = f (lowercase)”
Now I donot want to resend the exponent in every
“MarketData Message MsgType = X or W” and want the already
sent field to be applied at the client end. Moreover I donot
want to convert the Prices to Scaled numbers as I want to
retain the precision and avoid conversion. Is there a way I
can specify this in FAST?

Thanks and Regards Darshan Khedekar

[ original email was from Darshan Khedekar - darshan.khedekar.ext@deutsche-boerse.com ]
Hi Rolf

Thanks for the reply.
Our native representation stores mantissa and exponent separately in uint32 fields. Just before using the price the decimals are applied and the value is computed.

Best Regards
Darshan

Hi Darshan,

you can use a constant exponent if you have the same number of
decimals for all instruments that are rendered with a specific
template. For example:


The exponent will not occupy a pmap slot and the decimal number is
assumed to have two decimals.

You can use copy encoding for the exponent if you want more flexibility
in choice of decimals within a template:


In this case the exponent and mantissa will occupy one pmap slot each,
but the exponent will not be rendered on the wire as long as you stick
to the same exponent value.

(or just: )

I’m not sure I follow your line of thought regarding that you want to
avoid conversion in order to retain precision as decimal numbers provide
an exact representation. So, you will be able to retain that precision,
given that your native representation is exact.

How do you represent prices internally?

Best, Rolf

Hi

I have a problem with the Prices that I want to distribute through
FAST. I have a fixed number of decimal places for each instrument that
I have already sent with the “SecurityStatus Message - MsgType = f
(lowercase)” Now I donot want to resend the exponent in every
“MarketData Message MsgType = X or W” and want the already sent field
to be applied at the client end. Moreover I donot want to convert the
Prices to Scaled numbers as I want to retain the precision and avoid
conversion. Is there a way I can specify this in FAST?

Thanks and Regards Darshan Khedekar

Hi Darshan,

just to make sure I understand you correctly:
The decimal number 2.15 would be represented as
mantissa = 215 decimals = 2?

Best,
Rolf

Hi Rolf

Thanks for the reply. Our native representation stores mantissa and
exponent separately in uint32 fields. Just before using the price the
decimals are applied and the value is computed.

Best Regards Darshan

Hi Darshan,

you can use a constant exponent if you have the same number of
decimals for all instruments that are rendered with a specific
template. For example:


The exponent will not occupy a pmap slot and the decimal number is
assumed to have two decimals.

You can use copy encoding for the exponent if you want more
flexibility in choice of decimals within a template:


In this case the exponent and mantissa will occupy one pmap slot each,
but the exponent will not be rendered on the wire as long as you stick
to the same exponent value.

(or just: )

I’m not sure I follow your line of thought regarding that you want to
avoid conversion in order to retain precision as decimal numbers
provide an exact representation. So, you will be able to retain that
precision, given that your native representation is exact.

How do you represent prices internally?

Best, Rolf

Hi

I have a problem with the Prices that I want to distribute through
FAST. I have a fixed number of decimal places for each instrument
that I have already sent with the “SecurityStatus Message - MsgType
= f (lowercase)” Now I donot want to resend the exponent in every
“MarketData Message MsgType = X or W” and want the already sent
field to be applied at the client end. Moreover I donot want to
convert the Prices to Scaled numbers as I want to retain the
precision and avoid conversion. Is there a way I can specify this
in FAST?

Thanks and Regards Darshan Khedekar

[ original email was from Darshan Khedekar - darshan.khedekar.ext@deutsche-boerse.com ]
Yup, you got it right.
Thanks
Darshan

Hi Darshan,

just to make sure I understand you correctly: The decimal number 2.15
would be represented as mantissa = 215 decimals = 2?

Best, Rolf

Hi Rolf

Thanks for the reply. Our native representation stores mantissa and
exponent separately in uint32 fields. Just before using the price the
decimals are applied and the value is computed.

Best Regards Darshan

Hi Darshan,

you can use a constant exponent if you have the same number of
decimals for all instruments that are rendered with a specific
template. For example:


The exponent will not occupy a pmap slot and the decimal number is
assumed to have two decimals.

You can use copy encoding for the exponent if you want more
flexibility in choice of decimals within a template:


In this case the exponent and mantissa will occupy one pmap slot
each, but the exponent will not be rendered on the wire as long as
you stick to the same exponent value.

(or just: )

I’m not sure I follow your line of thought regarding that you want
to avoid conversion in order to retain precision as decimal numbers
provide an exact representation. So, you will be able to retain that
precision, given that your native representation is exact.

How do you represent prices internally?

Best, Rolf

Hi

I have a problem with the Prices that I want to distribute through
FAST. I have a fixed number of decimal places for each instrument
that I have already sent with the “SecurityStatus Message -
MsgType
= f (lowercase)” Now I donot want to resend the exponent in every
“MarketData Message MsgType = X or W” and want the already sent
field to be applied at the client end. Moreover I donot want to
convert the Prices to Scaled numbers as I want to retain the
precision and avoid conversion. Is there a way I can specify this
in FAST?

Thanks and Regards Darshan Khedekar

Great,

that means you can take full advantage of the decimal
representation without even having to do a conversion
as your internal representation is the same as the one
used for decimal numbers in FAST.

The exponent representation is the number of decimals
negated (decimals=2 yields exponent=-2)

/Rolf

Yup, you got it right. Thanks Darshan

Hi Darshan,

just to make sure I understand you correctly:
The decimal number 2.15
would be represented as mantissa = 215 decimals = 2?

Best, Rolf