Skip to content

livinginthepast/complex_num_sigil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComplexNumSigil

Adds a ~i sigil for working with the ComplexNum package.

Documentation can be found at https://hexdocs.pm/sci.

Installation

This package can be installed by adding complex_num_sigil to your list of dependencies in mix.exs:

def deps do
  [
    {:complex_num_sigil, "~> 0.1.0"}
  ]
end

Usage

import ComplexNumSigil

# Integers
~i{0} == ComplexNum.new(1)
~i{0+12i} == ComplexNum.new(0, 12)

# Floats
~i{0.11+0.12i} == ComplexNum(0.11, 0.12)
~i{1.1+3.12e-12i} == ComplexNum.new(1.1, 3.12e-12)

# Negative numbers
~i{-12-50i}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages