Skip to content

Big power of integer returns truncated answer #90

Description

@nulta

image

For example, as in $2^N$, Calctus silently returns truncated answer if $N$ is bigger than 49 :
$2^{48} = 281474976710656$ (correct)
$2^{49} = 562949953421312$ (correct)
$2^{50} \stackrel{?!}{=} 1125899906842620$ (incorrect)
$2^{51} \stackrel{?!}{=} 2251799813685250$ (incorrect)
...
$2^{63} \stackrel{?!}{=} 9223372036854780000$ (incorrect. should be $9223372036854775808$)
$2^{64} \stackrel{?!}{=} 18446744073709600000$ (incorrect. should be $18446744073709551616$)

It returns correct answer if we don't directly use ^ with big numbers.
e.g. 2^40 * 2^24 returns right answer of $2^{64}$.

This issue can be especially troublesome on some cases, such as calculating the value of UINT64_MAX or INT64_MAX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions