Skip to main content
Stack Overflow
  1. About
  2. For Teams

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
0 votes
3 answers
99 views

I want to construct objects which support arithmetic operations and have extra methods, e.g: class Timestamp(int): def as_seconds(self): return self / 90000 The extra method works: >&...
4 votes
1 answer
109 views

In love2D I have a string that represents a mathematical expression, for example: local expr1 = "[p35] div [p36]" local expr2 = "((([p35]*100) div [p36]) mod 100)" local params = {...
darkfrei's user avatar
  • 638
-1 votes
1 answer
116 views

print(krit) names weight 1 may 36 2 mayer 49 3 mayo 35 4 mali 50 > mean(krit$weight) [1] 42.5 > typeof(weight) [1] "double" > typeof(names) [1] "character&...
Advice
1 vote
21 replies
407 views

From the man pages, I found that size_t has the range of 0 to SIZE_MAX, and ssize_t has the range of -1 to SSIZE_MAX. So, after printing those values on a 64bit system, I have the following results: ...
sat0sh1c's user avatar
1 vote
2 answers
225 views

The following code is trying to set the test array in the first for loop, but it can't be used in the second for loop. int main() { int *test[3]; /** Try to set the array value one by ...
stackbiz's user avatar
  • 1,928
2 votes
1 answer
119 views

I working on a code where it is necessary to have large integers, here is a simplified version of it (len_class.py): class BigLen(): def __len__(self): return 10**100 However I'm running ...
4 votes
2 answers
180 views

I am trying to make my own file compressor and some of the chars in the file that I am trying to compress are '�'. I tried: #include <iostream> int main(){ std :: cout << (int)'�'; ...
3 votes
2 answers
238 views

I am trying to solve a problem posed in this question which asks that a program be written that calculates logarithms of numbers without including <math.h>. I wrote the following program: #...
uran42's user avatar
  • 469
4 votes
2 answers
192 views

I'm seeing a strange (to me) difference in behavior between Clang and GCC when comparing an integer with its negation. Also, pre-v12 GCC behaves like Clang. Code is below, but also here's a live link ...
jwd's user avatar
  • 11.4k
3 votes
1 answer
109 views

The following lex rules are copied from int_literal in docs of rust nightly. INTEGER_LITERAL -> ( DEC_LITERAL | BIN_LITERAL | OCT_LITERAL | HEX_LITERAL ) SUFFIX_NO_E? DEC_LITERAL -> ...
Mike Li's user avatar
  • 81
5 votes
1 answer
137 views

I recognized that int(unicode_string) sometimes gives obscure results. E.g. int('᪐᭒') == 2. >>> bytes('᪐᭒', 'utf-8') b'\xe1\xaa\x90\xe1\xad\x92' >>> [f'U+{ord(c):04X}' for c in '᪐᭒'] ...
-4 votes
2 answers
127 views

This script takes lines from a file of lottery numbers, and is supposed to check for errors. For example, in the following: week 1;17,19,35,23,8,20,36 week 2;24,28,35,8,3,22 week x;23,29,38,1,35,18,25 ...
Dominic 's user avatar
0 votes
0 answers
62 views

Why is the sum of the iaea_mass_dat_trunc$AM_WN (integer) and iaea_mass_dat_trunc$AM_frac (numeric) 499496.6 for all results? How do I get the appropriate result (for example, the sum of the values in ...
Brian's user avatar
  • 117
5 votes
5 answers
423 views

I am reading modern C, and on page 66, I come across following section: Remember that value 0 is important. It is so important that it has a lot of equivalent spellings: 0, 0x0, and ’0円’ are all the ...
Nan Xiao's user avatar
  • 17.8k
1 vote
1 answer
148 views

Imagine: int full = static_cast<int>(uint8_t_var); Does anything actually happen under the hood here? If you're on a machine with 64 bit registers, I assume that the higher bits of uint8_t_var ...

15 30 50 per page
1
2 3 4 5
...
1551

AltStyle によって変換されたページ (->オリジナル) /