Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BigInt for Int64 and UInt64 #836

Open
csmith-rtr opened this issue Feb 9, 2022 · 0 comments
Open

Use BigInt for Int64 and UInt64 #836

csmith-rtr opened this issue Feb 9, 2022 · 0 comments

Comments

@csmith-rtr
Copy link

rclnodejs currently seems to detect if a 64bit integer is greater than Number.MAX_SAFE_INTEGER and returns either a number or a string depending on if it is or not. This was originally tracked by #103 which was before bigint was introduced. It would be nice to use the new native type rather than changing the type that can be returned.

See below. Ran ros2 topic pub with std_msgs/Int64 data type and printed out the message and the type of the data field. Changed the published value between Number.MAX_SAFE_INTEGER and one slightly larger.

Got Message: {"data":"9007199254740993"}
Type: string
Got Message: {"data":9007199254740991}
Type: number

The typescript message definitions also do not indicate that the data field can be a string.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant