I think that the function f in Mr. Wizard's answer linked above may be what you want.
But let me ask you, when you say you want N[1/Sqrt[3], 1] which is 0.6, do you want that precision maintained throughout calculations?
That is, if I enter 1/.6 it returns 1.66667 with a repeating decimal representation. But if I force the precision to be 1 on this calculation like
1/N[1/Sqrt[3], 1]
(* 2. *)
then it would be rounded to 2. Here is the tricky part, when you multiply numbers with different precision, then the set precision is thrown out,
1.0/N[1/Sqrt[3], 1]
(* 1.73205 *)
So you may think the answer would be to wrap nx, ny, and nz in the same precision, but that seems to have no effect on the outcome of NSolve. Giving NSolve the option WorkingPrecision->1 has no effect either.
The only method that seems to influence the results from NSolve is strictly rounding the number.
Using a modified version of Mr. Wizard's function (the original doesn't have an effect here),
nRound[x_, n_] :=
Round[x, 10.^(1 - n + ⌊Log10@Abs@x⌋)];
Then we get
nx = 1.5;
ny = 1.6;
nz = 1.7;
sx = nRound[1/Sqrt[3], 1];
sy = nRound[1/Sqrt[3], 1];
sz = nRound[1/Sqrt[3], 1];
NSolve[1/n^2 ==
sx^2/(n^2 - nx^2) + sy^2/(n^2 - ny^2) + sz^2/(n^2 - nz^2), n,
WorkingPrecision -> 2]
(* {{n -> 0. + 5.66204 I}, {n ->
0. - 5.66204 I}, {n -> -1.65497}, {n -> 1.65497}, {n ->
1.5394}, {n -> -1.5394}} *)
Changing the 1 to a 3 gives
{{n -> -45.9999}, {n -> 45.9999}, {n ->
1.65466}, {n -> -1.65466}, {n -> -1.53909}, {n -> 1.53909}}
nx,ny, andnzare undefined – Jason B. Apr 06 '16 at 13:33fin Mr. Wizard's answer linked above may be what you want. But let me ask you, when you say you wantN[1/Sqrt[3], 1]which is0.6, do you want that precision maintained throughout calculations? That is, if I enter1/.6it returns1.66667with a repeating decimal representation. But if I force the precision to be 1 on this calculation like1/N[1/Sqrt[3], 1], then it would be rounded to2– Jason B. Apr 06 '16 at 14:330.6throughout the calculation. – Vesnog Apr 06 '16 at 15:02