Questions tagged as 'tipagem'

4
answers

Mathematical division needs

On the Windows calculator: 9 / 3,0001 = 2,999 ... In my program: 9 / 3,0001 = 3; I would like to get this level of precision using C. See excerpts from my program: double op(double num1, double num2, char c) { if(c == '/')...
asked by 25.10.2014 / 18:23
7
answers

Best data type to work with money?

I'm developing a project for commercial automation, using PAF-ECF and everything else. What would be the best data type to work with SQL Server and C # for money issues? Especially in relation to rounding and truncations. I imagine the bes...
asked by 13.02.2014 / 23:33
4
answers

Type of the CPF or CNPJ field in the VARCHAR or INT database?

What type of CPF or CNPJ field in database VARCHAR or INT ? I've seen some posts suggesting to use INT to optimize performance in JOIN and filters. If you have 0 on the left, you can only complete it according...
asked by 22.01.2015 / 14:51
3
answers

What is the purpose of void in C?

I have questions about using void in functions. 1 ° Example: int somaV(int valor_1, int valor_2) { return valor_1 + valor_2; } I know that this function will return an integer which is the sum of the two parameters in the func...
asked by 09.11.2015 / 15:54
5
answers

What is the difference between string vs string?

I'd like to know what the actual difference is between String (upper case s) and string (lowercase s). Apparently the two have the same goals, but which one is "better" to use?     
asked by 01.02.2014 / 11:31
3
answers

Should we validate function parameters?

In languages like Java, the method parameters are "validated" in the compilation (at least the type): public void facaAlgo(String str) { // ... } // em algum outro lugar: int i = 2; this.facaAlgo(i); // erro de compilação! In dynamic typ...
asked by 02.12.2014 / 12:46
2
answers

How can -1 be greater than 4?

How can this code run this way ? #include <stdio.h> int main(void) { printf("tamanho de um inteiro: %d\n", sizeof(int)); if(sizeof(int) > -1) { printf("4 é maior que -1"); } else { printf("-1 é maior que...
asked by 21.01.2015 / 13:40
3
answers

Difference between the use of typeof and is

In C # when I need to check if a variable is of a certain type, I usually use the is : if(qualquerVariavel is int) Console.Write("A variável é int"); I know you can also check the type of a variable in other ways, one of them is u...
asked by 11.09.2015 / 21:14
2
answers

What kind of data (double, float or decimal) should I use to represent currency in .NET with C #?

Although I am aware of what would be best to use, I ask this question for teaching purposes since I see several examples of people using double in C #. But I've had problems with double for coin calculations and read in several pla...
asked by 01.04.2014 / 22:30
7
answers

How do I know if a variable is of type Number in JavaScript?

In javascript, because there is no declaration of variable types such as Integer , String , Boolean , etc., it is a difficult task to know what kind of value you are dealing with in a particular variable. / p> So, to make my...
asked by 04.02.2014 / 16:47