Tags "short" Result

Java instantiate Short object in Java

I was wondering why we can do: Long l = 2L; Float f = 2f; Double d = 2d; or even Double d = new Double(2); and not Short s = 2s; //or whatever letter it could be nor Short s = new Short(2); //I know in this case 2 is an int but couldn't it be casted internally or something? Why do we need to take the constructors either with a String

it1352 1 2019-05-22

C# Short Error: Negating the minimum value of a twos complement number is invalid

I have been encountering this error for my project, which involves working with Digital Audio Signals. So I have been getting the amplitude values and recently encountered this error. This occurs when the amplitude value encountered is "-32768" upon debugging. I am storing the values in a short[] array. I have a hunch that it has something to do

it1352 96 2019-05-10

Android: Sort List View data

I have some JSON data which I am pulling down from a server. One of the fields in this data is a distance value. I need to have the data sorted by distance from lowest to highest in the ListView. I am not sure how to go about it? Any help appreciated. Solution I don't know exactly what you want to do but there are few steps that are needed after

it1352 2 2019-05-08

Integer summing blues, short = short problem

Program in C#: short a, b; a = 10; b = 10; a = a b; // Error : Cannot implicitly convert type 'int' to 'short'. // we can also write this code by using Arithmetic Assignment Operator as given below a = b; // But this is running successfully, why? Console.Write(a); Solution There are two questions here. The first is "why is short plus short

it1352 0 2019-05-10

longs, long longs, short short long ints . . . huh?!

Is there any standard as to what a long and int mean or is it compiler dependent? Or furthermore architecture dependent? I know a short short long int isn''t actually a recognised type, but if you wanted to make sure it was 16-bit, 32-bit or 64-bit etc, can you rely on these type names alone? If not, is there any way to ensure you get a 64/32/16-b

it1352 0 2019-06-25

DOS Short Names

If I have a strig that represents a path, how can I programmatically get the "short" DOS name for it? For example, if I have "C:\Program Files\" I want "C:\Progra~1\". Thanks Solution If I have a strig that represents a path, how can I programmatically get the "short" DOS name for it? For example, if

it1352 1 2019-06-25

short circuit evaluation

bool finished = is_done(); if (finished && try_again()) { } Is my understanding of short circuit evaluation correct that if finished is false that try_again() will never be executed? Or does it get evaluated sometimes? Solution "Lassie" <zh*@woaini.comwrites: if (finished && try_again()) { } Is my understanding

it1352 2 2019-06-25

va_arg and short

I was compiling a program written by someone else about six years ago, and widely distributed at the time. It also includes makefiles for many different systems, so I know it has been compiled with many different compilers. I got compile errors when it used va_arg to fetch an argument of type short. That seemed a little strange to me, so I change

it1352 1 2019-06-25

short or int

I read in the first question in the FAQ that both short and int are guaranteed to be able to hold values up to 32,767. Then why would one use an int instead of a short if short takes less space? Solution john said: I read in the first question in the FAQ that both short and int are guaranteed to be able to hold values up to 32,767. Then why would

it1352 1 2019-06-25

UIGraphicsGetCurrentContext() short lifetime

I have a view which implements freehand drawing, but I have a small problem. I noticed on the iPad 3 that everything went to hell, so I tried to update my drawing code (probably as I should have done in the first place) to only update the portion that was stroked. However, the first stroke after open, and the first stroke after about 10 seconds o

it1352 0 2020-07-23