Slava Posted December 1, 2019 Report Posted December 1, 2019 Hello, When I try to initialize sc::bigunit from string: sc_biguint<128> test("0X9080706050403020100"); std::string st = test.to_string(sc_dt::SC_HEX); The string returned by test.to_string(sc_dt::SC_HEX) is: "0x0fffffffffffff9080706050403020100". What is the reason for leading 'F's? Thanks, Slava Quote
David Black Posted December 1, 2019 Report Posted December 1, 2019 You specified a signed number which was converted to unsigned under rules of twos complement. Change “0x to “0xus and you will obtain desired results. See section 7.3 String literals on page 199 of IEEE-1666-2011 for more information. swami-cst 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.