15,892,809 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Yves Goergen (Top 4 by date)
Yves Goergen
20-Jun-18 6:18am
View
Not the bytes are negative. Bytes are never negative, they range from 0 to 255. The complete integer number is negative. And I have the bytes that represent that number.
Yves Goergen
20-Jun-18 5:44am
View
And stupid me, the array length can only be 1, 2, 4 or 8, not 16. Your code doesn't work for me. When I replace '< 0' with '>= 0x80', it produces even higher positive values, longer than possible with 16 bit.
Yves Goergen
20-Jun-18 5:41am
View
Ehm, sorry, this is a Uint8Array, so no negative bytes here.
Yves Goergen
20-Jun-18 5:00am
View
The code is decoding a big-endian unsigned integer in its current form. It does not decode a signed integer. For example -200 as int16 is encoded as FF 38, and this code then decodes it to 65336.