Questions tagged [Data types] (45)

3
answers

What type in the database will allow you to record a number greater than 999,999?

There are in the database the price field, if the type of put float(7,4) , the payment above 999,999 is not: "checksum does not match", if you change the type to decimal if the number is not an integer, and for example, 10 rubles 54 kopecks, five payment fails: "checksum does not match" How to solve?
Samir.Littel asked April 18th 20 at 13:09
1
answer

How to register types using Flow?

I have a class for which you want to write the typesclass Point { constructor(x:number, y:number) { if (arguments.length > 2 || arguments.length < 2) { throw new Error('You send more or less arguments') } this.x = x; this.y = y; } static randomNumber(from:number, to:number) { if (arguments.length > 2 || arg...
lillie_Paucek asked April 3rd 20 at 19:07
2
answers

Why the **kwargs can't make a dictionary with a key of int?

def tst_func(**kwargs): print(kwargs) d = dict((('t', 2), (2, 2),)) print(d) tst_func(**d) Why doesn't this work? Error:Traceback (most recent call last): File "main.py", line 22, in tst_func(**d) TypeError: tst_func() keywords must be strings
carrie.Wiso asked April 3rd 20 at 17:55
1
answer

How to create a dictionary using dict?

There are two variables: x = 'one', y = 1 I want to create a dictionary with a key x and value y by the class dict. Other ways not interested. The logic, write the following:x, y = 'one', 1 my_dict = dict(x, y) Writes an error: "TypeError: dict expected at most 1 arguments, got 2"
hanna_OConnell asked April 3rd 20 at 17:17
2
answers

Multiplication of a real number by -1 occurs on a common basis, no faster than an arbitrary number?

In the algorithm many multiplications of numbers of type double by -1, in fact it is only necessary to change the sign. Multiplication of a real number by -1 occurs on a common basis, no faster than an arbitrary real number? If so, could we more cost-effective to change the sign?
ariane.McGlynn asked April 2nd 20 at 17:17
3
answers

It is possible to artificially reduce the precision of real numbers in C++?

It is possible to artificially reduce the precision of real numbers in C++? For example, to represent numbers, and all transactions were made with an accuracy of 3 significant digits. For illustration of numerical methods we need to create a rounding error, and they are usually very small. I want to do more than make it cle...
Kaylah.Me asked April 2nd 20 at 16:58
1
answer

How to write the interface for such an object in TypeScript?

Hello, tell me how to write the interface for an object like this: segmentsTaxonomy: 1: {segmentName: "GenderMale", segmentDescription: "Client is male"} 2: {segmentName: "GenderFemale", segmentDescription: "the Customer is female"} 3: {segmentName: "Recency1", segmentDescription: "the Customer bought recently"} 4: {segmen...
muhammad_Litt asked March 31st 20 at 21:17
2
answers

C# — how to select the data store in memory?

It was the case, forced the need to refer to the DBMS, but I survived it quite simple. Managed to divide the data into fragments of 1 - 20Mb, so that the queries are not captured more than one such file. That is, managed without any harm to share everything, from what I was able to abandon DBMS, in principle, back to XML an...
Donald38 asked March 29th 20 at 20:10
1
answer

How to convert code from Python 2.x in Python 3.7?

Found a working code, which is implemented on Python 2.x. It is fully performs the task I need. It can not properly lead to a version of Python 3.7. Don't know what's wrong with decode, help translate in Python 3.7from pyasn1.codec.der import decoder as asn1der asn_sig = "483045022100d7195c06318d25ba8257b7a925e38aeb172ca6...
leopoldo asked March 25th 20 at 11:41
3
answers

How to check data type?

I have input and it needs to get only int data type. If he did not int, it should ask to enter int data.
jillian.Fee asked March 24th 20 at 10:44