Почему делают мой .net Int64 ведет себя, как будто они были Int32?

Используйте фильтр для выбора столбцов, начинающихся с текста

def clean(text):
    text = text.str.lower()
    text_clean = text.str.replace('[^A-Za-z0-9]', ' ', regex = True)
    return text_clean
df.assign(**df.filter(like = 'Text').apply(clean))
7
задан Brann 6 May 2009 в 13:28
поделиться

2 ответа

Your RHS is only using Int32 values, so the whole operation is performed using Int32 arithmetic, then the Int32 result is promoted to a long.

Change it to this:

Int64 a = 256*256*256*128L;

and all will be well.

20
ответ дан 6 December 2019 в 07:28
поделиться

Use:

Int64 a = 256L*256L*256L*128L;

the L suffix means Int64 literal, no suffix means Int32.

What your wrote:

Int64 a = 256*256*256*128

means:

Int64 a = (Int32)256*(Int32)256*(Int32)256*(Int32)128;
4
ответ дан 6 December 2019 в 07:28
поделиться
Другие вопросы по тегам:

Похожие вопросы: