Home » Julia

VERSION Constant in Julia

Julia | VERSION Constant: In this tutorial, we are going to learn about the VERSION constant with examples in Julia programming language.
Submitted by IncludeHelp, on April 02, 2020

Julia | VERSION Constant

VERSION is a constant of VersionNumber type in Julia programming language, it is used to describe a VersionNumber object, it returns the current version number of Julia programming language.

Syntax:

    VERSION

Example 1:

In this example, we are taking a variable x and assigning it with VERSION. We are printing the value and type of x using using println() function and typeof() function.

# Julia example of VERSION

x = VERSION

println("x: ", x)
println("typeof(x): ", typeof(x))

Output

x: 1.3.1
typeof(x): VersionNumber

Example 2: Comparing with the VERSION

# Julia example for comparing versions

if v"0.2" <= VERSION < v"0.3-"
    # do something, if true
    println("True")
  else
    # do something, if true
    println("False")
end

Output

False

Reference: Julia constants



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.