Skip to content

Representation of float values in a list #790

Answered by crapo
AbhaMoitra asked this question in Q&A
Discussion options

You must be logged in to vote

The "list" built-in function converts floats to doubles. I don't remember why this is done, but I think there's a reason. The conversion uses the java.lang.Float class:
'''((Float)v).doubleValue()'''
For the float 2.4, this returns the value "2.4000000953674316".

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@AbhaMoitra
Comment options

Answer selected by AbhaMoitra
Comment options

You must be logged in to vote
3 replies
@crapo
Comment options

@crapo
Comment options

@AbhaMoitra
Comment options

Comment options

You must be logged in to vote
1 reply
@AbhaMoitra
Comment options

Comment options

You must be logged in to vote
1 reply
@AbhaMoitra
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants