question

Upvotes
Accepted
10 2 6 9

What's the difference btw Real64 and Double?

Can I treat Real64 as a double? If not, make sense to convert a Real64 into Double?

#productrfa-api#contentc++
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
Accepted
78.8k 250 52 74

@ming.cheng

Thanks for reaching out to us.

Real64 contains the MagnitudeType property which defines how to display or interpret the value contained in Real64. It is used to maintain the presentation (fractions, or exponentials) sent by exchanges.

For example, some exchanges may use fractions to represent prices.

1676523282502.png

Real64 can support this kind of data by using the MagnitudeType property (rfa::data::Divisor256). However, Real64 can be converted to Double for calculation.

The sample code looks like this:

        case DataBuffer::RealEnum:
            write("%f   ", dataBuffer.getDouble());
            write("%s", dataBuffer.getAsString().c_str());
            break;

The output is:

1676523611353.png

I hope that this information is of help.


1676523282502.png (6.2 KiB)
1676523611353.png (19.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
10 2 6 9

Very clear. thanks.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.