Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Julia - significance of f0 after a number

Tags:

numbers

julia

What is the significance of f0 in the following:

julia> 1.25f3

1250.0f0

What is the difference with 1.25 e3 which means 1.25 * 10^3 ?

I looked for in the documentation, but I did not find it...

like image 262
Julien Avatar asked Nov 26 '25 13:11

Julien


1 Answers

That is a very old manual you are reading, take a look at this section instead: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/ . The TL;DR is that with f you get Float32 (single precision) and with e you get Float64 (double precision):

julia> typeof(1.25f3)
Float32

julia> typeof(1.25e3)
Float64
like image 134
fredrikekre Avatar answered Nov 28 '25 09:11

fredrikekre



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!