question

Upvotes
Accepted
321 1 0 8

我们有一个NIP向TREP发布实时更新,知道是什么问题吗?

当我们通过NIP从RFA C++发布2dp时,它发布了意外的6dp值

小程序创建了一个发布器,发布UPLIMIT=0,然后UPLIMIT=2109.45,最后UPLIMIT=2109.45,精度提示为2,所有这些值直接在代码中硬编码。为什么会出现这个意外的6dp值?

UPLIMIT : REAL 2 : [0.000000]

UPLIMIT : REAL 5 : [2109.449999]

UPLIMIT : REAL 4 : [2109.44]

treprfa
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.

1 Answer

· Write an Answer
Upvote
Accepted
321 1 0 8

我认为这可能是双数和整数相乘时的一个限制,正如这个主题中提到的。

例如,下面的代码打印出2109449999,而不是2109450000。

1654937845456.png

你可以尝试该主题中提到的解决方案(llround):

1654937877623.png


1654937845456.png (4.9 KiB)
1654937877623.png (5.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.

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.