integer

Defining a class

Just a quick question, im defining a class were only a set of integers is used. I cannot use the following datatypes in defining my class: set, frozenset and dictionaries. i need help defining: remove(self,i): Integer i is removed from the set. An exception is raised if i is not in self. discard(self, i): integer i is removed from th...

Make Scrollbar Max as long? - Vb6

Hey guys, I was working on my vb6 project, and I needed my scrollbar max to reach 40000. Though I can assume that the max was around 32000 since the scrollbar max is an integer. How can I change this? Thanks, Kevin ...

Convert integer into byte array (Java)

Hi, since Java doesn't provide a default way to do this, what's a fast way to convert an Integer into a Byte Array? e.g. 0xAABBCCDD => {AA, BB, CC, DD} ...

Storing an integer into a char* in C++

I'm writing some code that returns an integer, which then needs to be outputted using printw from the ncurses library. However, since printw only takes char*, I can't figure out how to output it. Essentially, is there a way to store a integer into a char array, or output an integer using printw? ...

Possible to store string and integers in one object

Is it possible to store a string and 11 integers in the same object. Thanks, Alex ...

.NET / C# - Allow overflowing of integers

Hello, Recently i started making a item container, and every time the user tries to add an item into the container. If somehow the same item type exists, it'll stack them on top of each other, but there's a limit, which is int.MaxValue and if i tried: if (2147483647 + 2147483647 > int.MaxValue) That would give me the following error:...

Which radio button is selected in a TRadioGroup?

As you can see in my question history, I'm developing a eBook manager, that will be open-source and I will release it in about 10 days, but I have a TRadioGroup, as you can see: And I want to store somethings in a variable(that needs to be a Integer) that will be "linked" with this TRadioGroup. I need to do a if function like this: ...

Convert Integer Into String

I have a some numbers stored in a Integer called mode, but I need to use they in a TProcess. For this I need to convert the Integer into a String, because if I don't do this, I got the error: Incompatible types: got "LongInt" expected "AnsiString" Then I want to know how I can convert a Integer into a String? ...

Check if int is between two numbers

Why can't do you this if you try to find out whether an int is between to numbers: if(10 < x < 20) Instead of it, you'll have to do if(10<x && x<20) which seems like a bit of overhead. ...

How can I turn 000000000001 into 1?

I need to turn a formatted integer into a regular integer: 000000000001 needs to be turned into 1 000000000053 needs to be turned into 53 000000965948 needs to be turned into 965948 And so on. It seems that a simple int(000000000015) results in the number 13. I understand there is some weird stuff behind the scenes. What is the be...

What is wrong with this mysql query?

Hai guys, I ve tried a query and i dont know what is wrong with the select statement,when i execute this no records are returned... It seems rollid=3 is the prob records with rollid 3 are not fetched, select * from tbl_emp_personal_master where dEmp_id ='7' dEmp_id is int I even tried removing quotes from '7' to 7 it didnt help ...

Quickly add + to positive strings [PHP]

Hay all, is there a PHP function which adds "+" to positive strings? i.e function(4) // returns +4 function(1.0) // returns +1.0 function(-1) // returns -1 function(0) // returns +0 Thanks EDIT: wants to take and return strings. ...

Float versus Integer arithmetic performance on modern chips

Consider a Viterbi decoder on an additive model. It spends its time doing additions and comparisons. Now, consider two: one with C/C++ float as the data type, and another with int. On modern chips, would you expect int to run significantly faster than float? Or will the wonders of pipelining (and the absence of multiplication and divisio...

Python: why aren't variables updating?

A python program that I'm debugging has the following code (including print statements for debugging): print "BEFORE..." print "oup[\"0\"] = " + str(oup["0"]) print "oup[\"2008\"] = " + str(oup["2008"]) print "oup[\"2009\"] = " + str(oup["2009"]) oup0 = oup["0"] oup2008 = oup["2008"] oup2009 = oup["2009"] ouptotal = oup2008 + oup2009 p...

Should I use uint in C# for values that can't be negative?

I have just tried implementing a class where numerous length/count properties, etc. are uint instead of int. However, while doing so I noticed that it's actually painful to do so, like as if no one actually wants to do that. Nearly everything that hands out an integral type returns an int, therefore requiring casts in several points. I ...

Integer counter - What to do when Max-Value?

How do you solve the max value problem when using an integer counter, that looks like counter = counter + 1; When this reaches the max value, how do you know this happened? Do you add another counter for this counting how often this happened? My question concerns about java. ...

stick integer to string and char*

Dear all, How can I add an integer variable to a string and char* variable? for example: int a = 5; string St1 = "Book", St2; char *Ch1 = "Note", Ch2; St2 = St1 + a --> Book5 Ch2 = Ch1 + a --> Note5 Thanks ...

please help me to store integer value with 0 as perfix in SQL Server

I have a column with bigint datatype in SQL Server 2005. I want to store 0347 in that.. (0 should not be removed) means their must be at least four value like: 0034 , 0007, 0423,4445. ...

Convert a string to int (But only if really is an int)

In college I was asked if our program detects if the string enter from command line arguments is a integer which it did not(./Program 3.7). Now I am wondering how I can detect this. So input as for example a is invalid which atoi detects, but input like for example 3.6 should be invalid but atoi will convert this to an integer. #includ...

Designing databases: storing user stats in games(i.e. owned money) and 32bit integer overflow.

Hello, I am creating an little hobby database driven browser based game and I stumbled across this problem: I store money owned by users as an 32bit integer field (to be precise: two fields. One stores money in players hand, the other - money stored in bank). We all know, that maximum value, which can be stored in 32 bits is 2^32-1. I ...