sprintf and minus sign problem
古いコメントを表示
I have a problem understanding the sprintf function in a specific case:
sprintf('%.2f', 0)
produces: "0.00" , as expected.
In my case I have a variable [value] that should equal 0:
value == 0
ans = 1
but
sprintf(%.2f, value)
results in "-0.00" (a minus sign is added)
Is there any chance that [value] still contains something different from 0, eventhough value == 0 retuns TRUE?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Code Performance についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!