int tag

57 questions


1 answers
150 views
0
Why does 0.1f become 10 times slower if you change it to zero

When I ran it on Visual Studio 2010 SP1,Source Code 1 operates about 10 times faster than Source Code 2.There are only two lines that change. I don't think there's much differenceWhy is the performanc...


1 answers
71 views
0
To divide two integers and save them as prime numbers?

I thought 0.5 would come out if I said 1/2, but 0 came outIf you divide two integers, you just cut off the decimal pointWhen a and b are int c = a/bHow do we get c to float as a result?a = 1b = 2print...


1 answers
62 views
0
When switching int to String in Java, which is better, Integer.toString(i) or new Integer(i).toString()?

Someone asked me a question, and when I initialized a large amount of int,What's the difference if you have?

1 years ago

1 answers
124 views
0
To output variables & properties for an object

Does Python have a function like print_r of PHP?I have to see the status of the object when I debug it.Is there a similar function?


1 answers
118 views
0
I want to change it to a string without any unnecessary parts such as zero below the decimal point when I print out the real number, what should I do?

On 64-bit operating systems, double represents up to +-253. Until 53I'm using double because I think the size of the number I'm expressing is about unsigned 32-bit Integer. The problem is that even if...


1 answers
97 views
0
It's weird to compare integers with is

When running Python 2.5.2>>> a = 256>>> b = 256>>> a is bTrue # Of course it's true>>> 257 is 257True # If you compare 257 directly, it's true>>> a = 257&g...


2 answers
138 views
0
How do I write float instead of an integer in the step of range()?

Can I increase from 0 to 1 by 0.1 by using range()?Since you write range(0,1,0.1), the step can only receive an integer.for i in range(0, 1, 0.1): print ifor i in range(0,1,0.1):TypeError: range() int...

1 years ago

2 answers
59 views
0
What type is size_t exactly?

I know that sizeof() returnsWhat else is there?Is it a data type?for(i = 0; i < some_size; i++)When writing these repetitive statements, i is int? size_t? Which one should I write?

1 years ago

1 answers
107 views
0
GCC does not optimize a*a*a*a*a*a to (a*a*a)*(a*a*a).

As far as I know, the compiler optimizes power(a,2) to a*apow(a,6) does not optimize, but calls the library function pow().The C++ Intel Compiler optimizes you to 6Why does the GCC C compiler optimize...


1 answers
98 views
0
What does the constant 0.0039215689 do in the graphic header?

0.0039215689 is used a lot in the graphic header fileWhat's the point?Why do you always write 0.0039215689 without setting it to const?If you look at the first code on Google (here )void RDP_G_SETFOGC...

« - 2 - »

© 2024 OneMinuteCode. All rights reserved.