Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

Negative Values seen for numbers greater than 0x7FFF

JCIDE related questions and answers.

Moderators: product, kuafu

Kamishetti
Posts: 2
Joined: Tue Apr 05, 2016 7:00 am
Points :53
Location: Noida
Contact:

Negative Values seen for numbers greater than 0x7FFF

Post by Kamishetti » Fri Apr 22, 2016 9:33 am

Dear Members,

Greetings for the day ahead.

I have started using the JCIDE very recently and developed a sample applet using it.

While I try to debug the applet for some command, I observed that by default, the IDE is treating all the numbers greater that 0x7FFF as negative numbers.

I do not know if there is some settings to be done to consider such numbers as positive only.

Anybody could kindly help me to get this issue resolved?

Please find the attached screenshot of my debugging and observation for more details.

In this example, I have taken hex value 0x9154, for which the IDE shows its value in brackets as -28332.

Thank you all in advance.

Have a nice weekend. :)
You do not have the required permissions to view the files attached to this post. Please login first.

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: Negative Values seen for numbers greater than 0x7FFF

Post by UNKNwYSHSA » Fri Apr 22, 2016 11:00 pm

Here is the documentation of java data types: https://docs.oracle.com/javase/tutorial ... types.html

Here's the explanation of your short value:
short: The short data type is a 16-bit signed two's complement integer. It has a minimum value of -32,768 and a maximum value of 32,767 (inclusive). As with byte, the same guidelines apply: you can use a short to save memory in large arrays, in situations where the memory savings actually matters.

You can use type int if the balance is greater than 32767.
Please pay special attention to this problem in your code.
sense and simplicity

Kamishetti
Posts: 2
Joined: Tue Apr 05, 2016 7:00 am
Points :53
Location: Noida
Contact:

Re: Negative Values seen for numbers greater than 0x7FFF

Post by Kamishetti » Mon Apr 25, 2016 12:08 am

Dear UNKNwYSHSA,

Thank you very much for your reply.

I will implement the changes and come back to you.

Have a nice week ahead.



Best Regards,

K. Sandeep Kumar.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 47 guests

JavaCard OS : Disclaimer