Explicit conversion to uint64 results in Conversion failed! error
Mostra commenti meno recenti
I want to convert 0xffffffff00000000 to uint64. When I write it in Command Window the value alone, it is already an uint64, but when I write it as uint64(0xffffffff00000000), I simply get "Conversion failed!" error, with no additional text.
How do I fix it?
16 Commenti
We cannot reproduce this behaviour (at least in R2026a) :
intmax("uint64")
uint64(0xffffffff00000000)
Which MATLAB version do you use ?
Bogdan -Ervin
circa 6 ore fa
We cannot help you in this forum because we cannot reproduce the error in the recent MATLAB release (R2026a).
Contact support:
together with the information about the MATLAB release you are using on your computer.
Bogdan -Ervin
circa 6 ore fa
Modificato: Bogdan -Ervin
circa 6 ore fa
Bogdan -Ervin
circa 6 ore fa
I am sorry, but up to which Release are responses given in this forum?
People in this forum are MATLAB users, not MATLAB employees. So they usually have access only to the latest releases (2025 - 2026) and thus can only give advice if the error happens for these latest releases. But your case looks like a bug for me - so only the official MATLAB support can help:
Just to make sure, the Matlab version which I am reffering to was identified? Because from your response, I am not sure it was identified.
What do you get if you type
version
in the MATLAB command window ? It will tell you the release you are using.
Bogdan -Ervin
circa 5 ore fa
Modificato: Bogdan -Ervin
circa 5 ore fa
Torsten
circa 5 ore fa
In few ocassions, a MATLAB employee has helped me in this forum. This was 2 years ago though (2024). I haven't interacted with this forum since then, so maybe they don't do this anymore.
There are some employees active in this forum, but there is no guarantee that they read your question and respond to it. Contacting support directly is the way to go :
Steps to Report a Bug
- Check the public MathWorks Bug Reports database first to see if the issue is already known.
- Log in to your MathWorks Account.
- Navigate to My Service Requests and choose Create a New Service Request.
- Provide a clear description, your MATLAB version, operating system, and a short code example that reproduces the issue. [1, 2, 3]
I could not reproduce on either R2019b or R2021b; unfortunately, I don't have R2020x installed presently.
@Bogdan -Ervin, be sure you've installed any updates for your version that may be available.
NOTA BENE that the "Release" info is so far down the page owing to the excessive white space and organization of the page display that almost nobody ever realizes it's even there; even @Torsten, one of the most veteran didn't catch you had filled it in. Of course, that you were one of the small percentage that did, that so many don't for similar reason on the Questions page cntributes in that one gets used to the fact it probably won't be there, anyway. <grin>. I complained at length about the format clear back in the very beginning of the transistion from usenet that while having the code feature is useful and needed, the information density of the page should be similar, but I didn't win much support. That whole RH column of ad content could be useful including the release info, etc., instead of all white space.
What do you get if you type
which -all uint64
in the MATLAB command window ?
Does uint64 work for smaller HEX numbers on your computer ?
What is the exact error message you get (I doubt that it's simply "Conversion failed!" - especially the exclamation mark is striking)
Another approach, note the suffix:
0xffffffff00000000u64
Bogdan -Ervin
circa 3 ore fa
dpb
circa 3 ore fa
@Bogdan -Ervin, that looks similar to R2019b; by R2021b all the data types show up as in the list @Torsten showed, but I don't see anything that looks to have aliased it in your system above.
Bogdan -Ervin
circa 2 ore fa
Bogdan -Ervin
circa 2 ore fa
dpb
31 minuti fa
Can only Accept Answers, not Comments. @Stephen23 may come back and move it; I'll hold off doing it for the time being anyways...
Risposta accettata
Più risposte (0)
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
