Skip to content

Commit

Permalink
Fix incorrect implicit type conversion output in variables.mdx docume…
Browse files Browse the repository at this point in the history
…ntation

- The "Implicit type conversion" section shows the output of implicitly converting an Integer to Float64 as an Integer. It should have been a Float. Updated it to 1.0 instead of 1
- Also added a print statement in that code snippet.

Signed-off-by: Eldho Ittan George <[email protected]>
  • Loading branch information
el2e10 authored Dec 23, 2024
1 parent f4b34fc commit 3d7d0b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/manual/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ floating-point type, it converts the value instead of giving a compiler error:

```mojo
var number: Float64 = Int(1)
print(number)
```

```output
1
1.0
```

As shown above, value assignment can be converted into a constructor call if the
Expand Down

0 comments on commit 3d7d0b3

Please sign in to comment.