v6d icon indicating copy to clipboard operation
v6d copied to clipboard

Get wrong value when put a big integer number

Open wangsq opened this issue 1 year ago • 4 comments

Describe your problem

When I put a big int number into vineyard, but get just 1 when the value is great than 2**63.


1. Get Right Value

value = 2**63-1
oid = client.put(value)

result = client.get(oid)
print(f'{value=}, {result=}, {value == int(result)}')

output:

value=9223372036854775807, result=9223372036854775807, True

2. Get Wrong Value When Big Integer

value = 2**63
oid = client.put(value)

result = client.get(oid)
print(f'{value=}, {result=}, {value == int(result)}')

output value=9223372036854775808, result=1, False

3. Use float cast , get right value

value = 2**126
oid = client.put(float(value))

result = client.get(oid)
print(f'{value=}, {int(result)=}, {value == int(result)}')

output value=85070591730234615865843651857942052864, int(result)=85070591730234615865843651857942052864, True

4. Use float cast , get wrong value, big float

value = 2**126+1
oid = client.put(float(value))

result = client.get(oid)
print(f'{value=}, {int(result)=}, {value == int(result)}')

output: value=85070591730234615865843651857942052865, int(result)=85070591730234615865843651857942052864, False


If is is a bug report, to help us reproducing this bug, please provide information below:

  1. Your Operation System version (uname -a): Linux 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug fd 11 Dumping 301618 Realtime Data. │ 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

  2. The version of vineyard you use (vineyard.__version__): '0.24.2'

  3. Versions of crucial packages, such as gcc, numpy, pandas, etc.:

  4. Full stack of the error (if there are a crash):

  5. Minimized code to reproduce the error:


If it is a feature request, please provides a clear and concise description of what you want to happen:

What is the problem:

The behaviour that you expect to work:

Additional context

Add any other context about the problem here.

wangsq avatar Oct 11 '24 04:10 wangsq