MathGroup Archive 1994

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: real number -> scientific C like string

  • To: mathgroup at christensen.cybernetics.net
  • Subject: Re: real number -> scientific C like string
  • From: Leslie Young <lyoung at chandon.arc.nasa.gov>
  • Date: Mon, 24 Oct 1994 11:46:32 -0700

CSciForm[x_] := NumberForm[ N[x],
	NumberFormat-> (SequenceForm[#1,"e", #3]& ), 
	ExponentFunction->Identity ];
Attributes[CSciForm] = {Listable,OneIdentity}

This works on the examples in the e-mail.  The NumberFormat trick is
given on p. 352 of the Mathematica book.  The attributes let you do
CSciForm[{3.123, 241.}].  I wrap N around x, because the exponent 
is always Null for NumberForm of an Integer.

	- Leslie Young





  • Prev by Date: RE: matrix of coefficients
  • Next by Date: Re: matrix of coefficients?
  • Previous by thread: real number -> scientific C like string
  • Next by thread: inverse CDF