Skip to content

mrb_read_float() converts "0.3" with a small error compared to strtod() #6182

@dearblue

Description

@dearblue

As far as I can tell, "0.6" and "0.7" also do not have the same value as strtod().

The reason I noticed this is mruby-marshal.
However, when I do Marshal.dump/load, the respective results for 0.6 and 0.7 seem to be equal.

% bin/mirb
mirb - Embeddable Interactive Ruby Shell

> Marshal.load(Marshal.dump(0.3)) == 0.3
 => false
> Marshal.load(Marshal.dump(0.6)) == 0.6
 => true
> Marshal.load(Marshal.dump(0.7)) == 0.7
 => true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions