An integer is a whole number negative, positive, or zero. i.e ... -2, -1, 0, 1, 2 ... Use this tag for questions about using, storing or manipulating integers.

learn more… | top users | synonyms

4
votes
3answers
275 views

I'm wondering if I'm doing this whole Haskell thing right

There may not be a "right" way to do it, but I've come to perceive Haskell as the kind of language, where literacy of the proposed programming paradigm is crucial to writing proficient code in the ...
2
votes
2answers
109 views

Determine if an int is within range

Can I somehow make this a bit cleaner using Math.[Somthing], without making a method for it !? int MaxSpeed = 50; if (Speed.X > MaxSpeed) Speed.X = MaxSpeed; if (Speed.X < MaxSpeed * -1) ...
1
vote
2answers
190 views

Spotify's “Reversed Binary Numbers” Problem

I wrote some Java code for Spotify's Reversed Binary Numbers puzzle and I tested it on my machine and I am almost positive that it behaves as expected. However, when I send it to puzzle AT spotify.com ...
1
vote
1answer
32 views

How to improve this functional python trial division routine?

The following functional program factors an integer by trial division. I am not interested in improving the efficiency (but not in decreasing it either), I am interested how it can be made better or ...
1
vote
0answers
29 views

NSArray and NSNumber-int conversions

I have a textView which is displaying a string. I also have an array which keeps track of where every line begins, it stores the "start index" or NSRange.location for every line. However, when text ...
1
vote
0answers
405 views

Android - get int array from database Cursor

I find this code quite ugly, but in fact, I don't see any finest way to achieve the goal. private static final String TABLE_NAME = "table_name"; private static final String[] allNeededColumns = ...
3
votes
2answers
240 views

Improving a custom integer class 2.0

As sort of a follow up to my previous question from a year ago, what are some suggestions you can think of that will improve this code, whether is directly programming related or algorithm related? I ...
5
votes
2answers
215 views

What can be done to improve a recursive method?

So I was experimenting with lists, sets, and finally maps when I spotted a pattern in my code to make it recursive. Now I haven't used recursion much in the past or at work and I was very excited to ...
1
vote
2answers
354 views

Improving a custom integer class

How can I improve upon this integer class that I wrote? I am/will be using this for some calculation intensive crypto algorithms, mainly POLY1305AES. I might even write RSA using this. I know that ...
5
votes
4answers
232 views

Adjusting integer based on multiple elements in int array

I'm working with the following code which adjusts an int based on multiple elements of an integer array. I am wondering if there's a cleaner, easier-to-read construct for this: int Blue = 0; int[] ...
3
votes
1answer
445 views

Speed optimising JavaScript code

I've written this following rather naïve branch-and-bound based IP solver. My question is whether there are any obvious JavaScript optimisations that could speed it up? I am not looking for ...