Re: [Clip] Re: how to use scientific notation in a clip?
- This was first sent last evening, but never appeared:
> I imagine it would be tricky to convert the resultThat depends. you could just go and divide regardless and let it give
> to scientific notation.
you the result as E9 and E12 and whatever and visually choose the one
that looks nicest. I wouldn't really want to do a thing like that in
clip language, but the canonic way, if clips can hack it, is
3*INT(LOG(x)/3) for the exponent.
N.B: full quotes are evil
I did some further study, especially of the note about math functions
that Sheri referred to (from 2003) and finally got the clip to
calculate the frequency in scientific notation. I took the logarithm
of the calculated frequency, used the FLOOR function to round the log
down to an integer, and divided the result by that power of 10 to get
The prompts (now commented out) helped me verify each step of the
H="Wavelength -> Frequency"
^!Set %wavelength%=^?[Enter the wavelength (cm)]
;^!Prompt ^%wavelength% cm
;^!Prompt ^%wavelength% cm = ^%frequency% cycles/sec.
^!Prompt ^%wavelength% cm = ^$Calc(^%frequency%/1e^%log_frequency%;3)
$ x 10^^%log_frequency% cycles/sec (scientific notation)