accuracy problems in uint64 numbers
古いコメントを表示
I encrypt uint64 numbers. Number x which encrypted as, for example, 9824265115183455531 decrypted as 9824265115183455488. This difference affects the final decrypted text. Is Matlab not gives accurate results when operates on uint64? how I overcome this problem?
4 件のコメント
James Tursa
2019 年 9 月 18 日
Please show us your code. Perhaps you are doing intermediate calculations in double and that is causing your loss of trailing digits problem.
Walter Roberson
2019 年 9 月 18 日
I think it must be something else, perhaps loss of precision on an intermediate step involving smaller numbers.
>> double(uint64(9824265115183455531)) - uint64(9824265115183455488)
ans =
uint64
768
>> uint64(double(uint64(9824265115183455531)))
ans =
uint64
9824265115183456256
Ansam Osamah
2019 年 9 月 18 日
Walter Roberson
2019 年 9 月 18 日
Sorry, it is a cloudy night here and my telescope cannot see your computer screen.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!