Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

f32 toString emits extra decimals #2873

Copy link
Copy link
@mattjohnsonpint

Description

@mattjohnsonpint
Issue body actions

Bug description

Calling toString on an f64 value works as expected, but doing the same on an f32 string introduces extra noise decimals. I suspect it is because the f32 value is being cast to f64 when passed into the dtoa function:

toString(this: f32, radix: i32 = 0): String {
return dtoa(this);
}

export function dtoa(value: f64): String {

Steps to reproduce

console.log((<f64>1.1).toString());  // "1.1"
console.log((<f32>1.1).toString());  // "1.100000023841858"

AssemblyScript version

v0.27.29

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.