Skip to content

float/doubles are rounded? #272

@howarth

Description

@howarth

Hello, here's some code

>>> d1
17.133574204226083
>>> str(d1)
'17.1335742042'
>>> repr(d1)
'17.133574204226083'
>>> f = mc.gateway.jvm.java.lang.Double(d1)
>>> f
17.1335742042
>>> f == d1
False

I would think that the last line should read True. However, it seems as though when a double (python float) goes from python to Java it is rounded in the same way that the str() function rounds the number

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions