Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Complex Number Formats In Various Programming Languages

Reference.ComplexNumberFormatsInVariousProgrammingLanguages History

Hide minor edits - Show changes to output

2010-01-27 11:33 by benjk -
Changed line 8 from:
* output with decimal comma: @@(2.50; 6.75)@@ or @@2,50+I6,75@@
to:
* output with decimal comma: @@(2,50; 6,75)@@ or @@2,50+I6,75@@
2010-01-27 11:32 by benjk -
Added lines 1-32:
!!!C99:
* input: @@2.5+6.75I@@
* output: @@2.50+6.75I@@

!!!Fortran:
* input: @@(2.5,6.75)@@
* output with decimal point: @@(2.50, 6.75)@@ or @@2.50+I6.75@@
* output with decimal comma: @@(2.50; 6.75)@@ or @@2,50+I6,75@@

!!!Haskell:
* input: @@2.5 :+ 6.75@@
* output: @@2.5 :+ 6.75@@

!!!Lisp:
* input: @@c#(2.5 6.75)@@
* output: @@C#(2.5 6.75)@@

!!!Lua:
* input: @@{2.5, 6.75}@@ or @@complex "2.5+6.75i"@@
* output:  @@2.5+6.75i@@

!!!Perl:
* input: @@cplx(2.5, 6.75)@@
* output: @@2.5+6.75i@@

!!!Python:
* input: @@c{2.5, 6.75}@@
* output: @@(2.5+6.75j)@@

!!!Ruby:
* input: @@Complex(2.5, 6.75)@@
* output: @@Complex(2.5, 6.75)@@