I am trying to understand what criteria dictates Zemax to round up decimals.
For instance: in the Aperture setting below. I inserted the following values and got rounded up values
X-Half Width: 8.325 → Zemax value = 8.325
Y-Half Width: 10.125 → Zemax value = 10.13
Why does Zemax treat the first entry differently from the second? It shouldn’t round up 8.325 differently than 10.125. But, it does. Can someone please explain to me if this is a possible bug or there is an internal logic that dictates how round-ups happen in Zemax.
Thanks - ASuku
Page 1 / 1
Hi Asuku,
Just a guess: perhaps 10.125 is seen internally as 1.0125 E-1, thus rounded to 1.013 E-1 = 10.13.
This is controlled with the Significant Digits setting.
From the help manual: Significant Digits Controls the number of digits shown for values in the editor properties dialog and the analysis settings dialog. For example, if the number of significant digits is set to “3” (the default), and an aperture on a surface in the Lens Data Editor has radius of 1.2345, then the value displayed in the Properties > Aperture dialog will be 1.23.
To add to Sean’s answer, the Editors tab also has a setting for this, controlling the display in the editors, while the General controls other displays. These are both strictly for display, and the actual value is stored in full floating resolution.
To complement @Kevin Scales reply, if one manually types: 1.23456789 in the X-Half Width aperture field of a surface, it might display as 1.23 (depending on the display settings):
But if we use the ZOSAPI to print the actual X-Half Width value with this line of code (Python):
Just one small point. OS stores all ray and lens system data to 64-bit precison, and all the ‘significant digit’ stuff does is set the formatting of the number when it’s printed in the LDE or some other place. There’s no rounding of the data used in the calculations, just in what is displayed in a text string that represents the value of a double-precision float.
Edit: Oops, Kevin already said that in fewer words